57 lines
2.2 KiB
Go
57 lines
2.2 KiB
Go
package controllers
|
||
|
||
import (
|
||
"git.rosy.net.cn/jx-callback/business/jxstore/knowledge"
|
||
"github.com/astaxie/beego/server/web"
|
||
)
|
||
|
||
type KnowController struct {
|
||
web.Controller
|
||
}
|
||
|
||
// @Title 查询知识条目
|
||
// @Description 查询知识条目
|
||
// @Param token header string true "认证token"
|
||
// @Param keyword query string false "关键字"
|
||
// @Param offset query int false "门店列表起始序号(以0开始,缺省为0)"
|
||
// @Param pageSize query int false "门店列表页大小(缺省为50,-1表示全部)"
|
||
// @Success 200 {object} controllers.CallResult
|
||
// @Failure 200 {object} controllers.CallResult
|
||
// @router /GetKnowledgeDepot [get]
|
||
func (c *KnowController) GetKnowledgeDepot() {
|
||
c.callGetKnowledgeDepot(func(params *tKnowGetKnowledgeDepotParams) (retVal interface{}, errCode string, err error) {
|
||
retVal, err = knowledge.GetKnowledgeDepot(params.Ctx, params.Keyword, params.Offset, params.PageSize)
|
||
return retVal, "", err
|
||
})
|
||
}
|
||
|
||
// @Title 更新知识条目
|
||
// @Description 更新知识条目
|
||
// @Param token header string true "认证token"
|
||
// @Param id formData int true "id"
|
||
// @Param content formData string false "内容"
|
||
// @Param isDel formData bool true "是否是删除"
|
||
// @Success 200 {object} controllers.CallResult
|
||
// @Failure 200 {object} controllers.CallResult
|
||
// @router /UpdateKnowledgeDepot [post]
|
||
func (c *KnowController) UpdateKnowledgeDepot() {
|
||
c.callUpdateKnowledgeDepot(func(params *tKnowUpdateKnowledgeDepotParams) (retVal interface{}, errCode string, err error) {
|
||
err = knowledge.UpdateKnowledgeDepot(params.Ctx, params.Id, params.Content, params.IsDel)
|
||
return retVal, "", err
|
||
})
|
||
}
|
||
|
||
// @Title 查询素材列表
|
||
// @Description 查询素材列表
|
||
// @Param token header string true "认证token"
|
||
// @Param offset query int false "门店列表起始序号(以0开始,缺省为0)"
|
||
// @Param pageSize query int false "门店列表页大小(缺省为50,-1表示全部)"
|
||
// @Success 200 {object} controllers.CallResult
|
||
// @Failure 200 {object} controllers.CallResult
|
||
// @router /GetMaterialList [get]
|
||
func (c *KnowController) GetMaterialList() {
|
||
c.callGetMaterialList(func(params *tKnowGetMaterialListParams) (retVal interface{}, errCode string, err error) {
|
||
return retVal, "", err
|
||
})
|
||
}
|