71 lines
1.4 KiB
Go
71 lines
1.4 KiB
Go
package application
|
|
|
|
import (
|
|
"finclip-app-manager/domain/entity/proto"
|
|
"finclip-app-manager/domain/service"
|
|
"finclip-app-manager/infrastructure/utility"
|
|
"net/http"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
/**
|
|
* @api {GET}
|
|
* @apiGroup Finclip App Manager
|
|
* @apiSuccessExample {json} Success Status:
|
|
* HTTP/1.1 200 OK
|
|
* {
|
|
* "errcode": "OK",
|
|
* "error": "成功",
|
|
* "data":{
|
|
*
|
|
* }
|
|
* }
|
|
* @apiErrorExample Error Status:
|
|
* HTTP/1.1 !=200 服务端异常
|
|
*/
|
|
func UpdateTempApp(c *gin.Context) {
|
|
var (
|
|
errRspData = make(map[string]interface{})
|
|
)
|
|
req := proto.UpdateTempAppInfoReq{}
|
|
err := c.BindJSON(&req)
|
|
if err != nil {
|
|
log.Errorf("UpdateTempApp bind json err:%s", err.Error())
|
|
utility.MakeLocRsp(c, http.StatusBadRequest, utility.FS_PARAM_ERR, errRspData)
|
|
return
|
|
}
|
|
appId := c.Param("appId")
|
|
log.Infof("UpdateTempApp appId:[%s],req:%+v", appId, req)
|
|
svr := service.NewAppTempInfoService()
|
|
svr.UpdateTempApp(c, appId, &req)
|
|
return
|
|
}
|
|
|
|
/**
|
|
* @api {GET}
|
|
* @apiGroup Finclip App Manager
|
|
* @apiSuccessExample {json} Success Status:
|
|
* HTTP/1.1 200 OK
|
|
* {
|
|
* "errcode": "OK",
|
|
* "error": "成功",
|
|
* "data":{
|
|
*
|
|
* }
|
|
* }
|
|
* @apiErrorExample Error Status:
|
|
* HTTP/1.1 !=200 服务端异常
|
|
*/
|
|
func GenTempApp(c *gin.Context) {
|
|
req := proto.CreateTempAppInfoReq{}
|
|
err := c.ShouldBindJSON(&req)
|
|
if err != nil {
|
|
log.Errorf("GenTempApp bind json err:%s", err.Error())
|
|
}
|
|
|
|
svr := service.NewAppTempInfoService()
|
|
svr.GenTempApp(c, req)
|
|
return
|
|
}
|