自动化代码增加 批量删除功能
This commit is contained in:
@@ -35,7 +35,7 @@ func CreateTemp(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
if a.AutoCreateApiToSql {
|
||||
apiList := [5]model.SysApi{
|
||||
apiList := [6]model.SysApi{
|
||||
{
|
||||
Path: "/" + a.Abbreviation + "/" + "create" + a.StructName,
|
||||
Description: "新增" + a.Description,
|
||||
@@ -48,6 +48,12 @@ func CreateTemp(c *gin.Context) {
|
||||
ApiGroup: a.Abbreviation,
|
||||
Method: "DELETE",
|
||||
},
|
||||
{
|
||||
Path: "/" + a.Abbreviation + "/" + "delete" + a.StructName+"ByIds",
|
||||
Description: "批量删除" + a.Description,
|
||||
ApiGroup: a.Abbreviation,
|
||||
Method: "DELETE",
|
||||
},
|
||||
{
|
||||
Path: "/" + a.Abbreviation + "/" + "update" + a.StructName,
|
||||
Description: "更新" + a.Description,
|
||||
|
@@ -48,6 +48,25 @@ func DeleteSysOperationRecord(c *gin.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
// @Tags SysOperationRecord
|
||||
// @Summary 批量删除SysOperationRecord
|
||||
// @Security ApiKeyAuth
|
||||
// @accept application/json
|
||||
// @Produce application/json
|
||||
// @Param data body request.IdsReq true "批量删除SysOperationRecord"
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
|
||||
// @Router /sysOperationRecord/deleteSysOperationRecordByIds [delete]
|
||||
func DeleteSysOperationRecordByIds(c *gin.Context) {
|
||||
var IDS request.IdsReq
|
||||
_ = c.ShouldBindJSON(&IDS)
|
||||
err := service.DeleteSysOperationRecordByIds(IDS)
|
||||
if err != nil {
|
||||
response.FailWithMessage(fmt.Sprintf("删除失败,%v", err), c)
|
||||
} else {
|
||||
response.OkWithMessage("删除成功", c)
|
||||
}
|
||||
}
|
||||
|
||||
// @Tags SysOperationRecord
|
||||
// @Summary 更新SysOperationRecord
|
||||
// @Security ApiKeyAuth
|
||||
|
Reference in New Issue
Block a user