【查询厂家信息列表参数修改】

This commit is contained in:
weizhihong 2023-08-18 10:56:20 +08:00
parent 289034b364
commit b33137dec3
4 changed files with 7 additions and 3 deletions

View File

@ -72,10 +72,9 @@ func pageQueryCategory(c *gin.Context) {
// @Failure 500 {object} dto.ErrorDto
// @Router /api/v1/category/list [get]
func listQueryCategory(c *gin.Context) {
req := dto.PageCategoryReqDto{}
req := dto.CategoryReqDto{}
if err := c.ShouldBind(&req); err != nil {
zap.S().Warn("查询参数绑定错误,使用默认参数", err)
req.Default()
}
zap.S().Debug("查厂家参数", req)
page, err := service.ListCategoryQuery(&req)

View File

@ -122,6 +122,7 @@ func convert(info *dynamics.TrainInfo, sta *state.TrainState, vs *memory.VerifyS
zap.S().Debugf("原始消息:[%d-%d-%d]", info.Number, info.Link, info.LinkOffset)
sta.HeadLinkId = strconv.Itoa(int(info.Link))
sta.HeadLinkOffset = int64(info.LinkOffset)
sta.Up = info.Up
id, port, offset, runDirection, pointTo := memory.QueryDeviceByCalcLink(vs, int32(info.Link), sta.HeadLinkOffset, sta.Up, sta.RunDirection)
zap.S().Debugf("转换后的消息:[%d-车头:%s-偏移:%d-上行:%v-是否ab:%v]", info.Number, id, offset, runDirection, pointTo)
sta.HeadDeviceId = id

View File

@ -5,6 +5,10 @@ type PageCategoryReqDto struct {
Name string `json:"name" form:"name"`
}
type CategoryReqDto struct {
Name string `json:"name" form:"name"`
}
type CategoryDto struct {
Id int `json:"id" form:"id"`
Code string `json:"code" form:"code"`

View File

@ -24,7 +24,7 @@ func PageCategoryQuery(query *dto.PageCategoryReqDto) (*dto.PageDto, error) {
}
// 查询草稿列表
func ListCategoryQuery(query *dto.PageCategoryReqDto) ([]*model.Category, error) {
func ListCategoryQuery(query *dto.CategoryReqDto) ([]*model.Category, error) {
d := dbquery.Category
dq := d.Where()
if query.Name != "" {