34 lines
837 B
Go
34 lines
837 B
Go
|
package exam
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
|
||
|
"dubbo.apache.org/dubbo-go/v3/common/logger"
|
||
|
"github.com/fonchain_enterprise/fonchain-main/api/exam"
|
||
|
"github.com/fonchain_enterprise/fonchain-main/pkg/e"
|
||
|
"github.com/fonchain_enterprise/fonchain-main/pkg/serializer"
|
||
|
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
|
||
|
"github.com/gin-gonic/gin"
|
||
|
)
|
||
|
|
||
|
func GetQuestionClassifies(c *gin.Context) {
|
||
|
req := new(exam.QuestionClassifyRequest)
|
||
|
if err := c.ShouldBind(req); err != nil {
|
||
|
logger.Errorf("GetQuestionClassifies ShouldBind err", err)
|
||
|
service.ResponseMsg(c, e.SUCCESS, serializer.Response{
|
||
|
Msg: err.Error(),
|
||
|
Status: e.Failed,
|
||
|
})
|
||
|
return
|
||
|
}
|
||
|
|
||
|
res, err := service.GrpcExamClientImpl.GetQuestionClassifies(context.Background(), req)
|
||
|
|
||
|
if err != nil {
|
||
|
service.Error(c, e.Error, err)
|
||
|
return
|
||
|
}
|
||
|
|
||
|
service.Success(c, res)
|
||
|
}
|