service/app/mix/controller/Raven_IQ_test_api.go

43 lines
1.1 KiB
Go
Raw Normal View History

2024-07-19 08:43:30 +08:00
package controller
import (
"service/api/errcode"
Raven_IQ_testproto "service/api/proto/Raven_IQ_test/proto"
"service/app/mix/service"
"service/bizcommon/util"
"service/library/logger"
"github.com/gin-gonic/gin"
)
func ApiCreateRavenIQTest(ctx *gin.Context) {
req := ctx.MustGet("client_req").(*Raven_IQ_testproto.ApiCreateReq)
2024-07-22 16:12:22 +08:00
id, ec := service.DefaultService.ApiCreateRavenIQTest(ctx, req)
2024-07-19 08:43:30 +08:00
if ec != errcode.ErrCodeRavenIQTestSrvOk {
logger.Error("ApiCreateRavenIQTest fail, req: %v, ec: %v", util.ToJson(req), ec)
ReplyErrorMsg(ctx, "server error")
return
}
2024-07-22 16:12:22 +08:00
data := &Raven_IQ_testproto.ApiCreateData{
Id: id,
}
ReplyOk(ctx, data)
2024-07-19 08:43:30 +08:00
}
func ApiGetRavenIQTestList(ctx *gin.Context) {
req := ctx.MustGet("client_req").(*Raven_IQ_testproto.ApiListReq)
vo, ec := service.DefaultService.ApiGetRavenIQTestList(ctx, req)
if ec != errcode.ErrCodeRavenIQTestSrvOk {
logger.Error("ApiGetRavenIQTestList fail, req: %v, ec: %v", util.ToJson(req), ec)
ReplyErrCodeMsg(ctx, ec)
return
}
data := &Raven_IQ_testproto.ApiListData{
ApiListVO: vo,
}
ReplyOk(ctx, data)
}