43 lines
1.4 KiB
Go
43 lines
1.4 KiB
Go
|
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)
|
||
|
}
|