1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- package apis
- import (
- "go-admin/app/observe/service"
- "go-admin/app/observe/service/dto"
- "go-admin/utils"
- "net/http"
- "github.com/gin-gonic/gin"
- )
- type BigModel struct {
- utils.OtApi
- }
- // List 获取Biz列表
- func (e BigModel) List(c *gin.Context) {
- req := dto.BizListReq{}
- svc := service.Biz{}
- if err := e.Init(c, &req, &svc.OtService); err != nil {
- return
- }
- resp := make([]dto.BizListResp, 0)
- var count int64
- if err := svc.List(&req, &resp, &count); err != nil {
- e.Error(http.StatusInternalServerError, err, err.Error())
- return
- }
- e.PageOK(resp, int(count), req.GetPageIndex(), req.GetPageSize(), "查询成功")
- }
- func (e BigModel) AiAnswerMe(c *gin.Context) {
- req := dto.AskAiModel{}
- bm := service.BigModel{}
- if err := e.Init(c, &req, &bm.OtService); err != nil {
- return
- }
- resp := new(dto.BigModelResp)
- if err := bm.RequestAiPlatform(&req, resp); err != nil {
- e.Error(http.StatusInternalServerError, err, err.Error())
- return
- }
- e.OK(resp, "查询完成")
- }
|