12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- package gn
- import (
- "eta_gn/eta_bridge/controller/resp"
- "eta_gn/eta_bridge/global"
- gnRequest "eta_gn/eta_bridge/models/request/gn"
- "eta_gn/eta_bridge/services/gn"
- "github.com/gin-gonic/gin"
- "github.com/go-playground/validator/v10"
- )
- // OA
- // @Description: 发布OA待办
- // @author: Roc
- // @receiver gc
- // @datetime 2024-10-29 13:23:42
- // @param c *gin.Context
- func (gc *GuoNengController) OA(c *gin.Context) {
- var req gnRequest.PostOAReq
- if e := c.Bind(&req); e != nil {
- err, ok := e.(validator.ValidationErrors)
- if !ok {
- resp.FailData("参数解析失败", "Err:"+e.Error(), c)
- return
- }
- resp.FailData("参数解析失败", err.Translate(global.Trans), c)
- return
- }
- oaReq := gn.OASendDbReq{
- AppPersonId: req.AppPersonId,
- AppPersonName: req.AppPersonName,
- AppTaskUrl: req.AppTaskUrl,
- TaskName: req.TaskName,
- StatusName: req.StatusName,
- Status: req.Status,
- AppTaskId: req.AppTaskId,
- }
- oaResp, err := gn.OASendDb(oaReq)
- if err != nil {
- resp.FailData("请求失败", err.Error(), c)
- return
- }
- resp.OkData("请求成功", oaResp.Data.TaskId, c)
- }
|