service/app/mix/controller/contact_customer_service_se...

43 lines
1.4 KiB
Go
Raw Permalink Normal View History

2023-12-23 22:03:53 +08:00
package controller
import (
"service/api/errcode"
contact_customer_service_sessionproto "service/api/proto/contact_customer_service_session/proto"
"service/app/mix/service"
"service/bizcommon/util"
"service/library/logger"
"github.com/gin-gonic/gin"
)
func ApiCreateContactCustomerServiceSession(ctx *gin.Context) {
req := ctx.MustGet("client_req").(*contact_customer_service_sessionproto.ApiCreateReq)
ec := service.DefaultService.ApiCreateContactCustomerServiceSession(ctx, req)
if ec != errcode.ErrCodeContactCustomerServiceSessionSrvOk {
logger.Error("ApiCreateContactCustomerServiceSession fail, req: %v, ec: %v", util.ToJson(req), ec)
ReplyErrorMsg(ctx, "server error")
return
}
data := &contact_customer_service_sessionproto.ApiCreateData{
SessionId: util.DerefInt64(req.Id),
}
ReplyOk(ctx, data)
}
func ApiGetContactCustomerServiceSessionListByMid(ctx *gin.Context) {
req := ctx.MustGet("client_req").(*contact_customer_service_sessionproto.ApiListByMidReq)
session, ec := service.DefaultService.ApiGetContactCustomerServiceSessionListByMid(ctx, req)
if ec != errcode.ErrCodeContactCustomerServiceSessionSrvOk {
logger.Error("ApiGetContactCustomerServiceSessionListByMid fail, req: %v, ec: %v", util.ToJson(req), ec)
ReplyErrCodeMsg(ctx, ec)
return
}
data := &contact_customer_service_sessionproto.ApiListByMidData{
Session: session,
}
ReplyOk(ctx, data)
}