Sfoglia il codice sorgente

fix: ShouldBindJSON → ShouldBindQuery for all GET handlers (dict, dict-detail, op-record)

lq 1 mese fa
parent
commit
f7ad1a8f0c

+ 1 - 1
internal/api/v1/system/sys_dictionary.go

@@ -96,7 +96,7 @@ func (s *DictionaryApi) UpdateSysDictionary(c *gin.Context) {
 // @Router    /sysDictionary/findSysDictionary [get]
 func (s *DictionaryApi) FindSysDictionary(c *gin.Context) {
 	var dictionary dao.SysDictionary
-	err := c.ShouldBindJSON(&dictionary)
+	err := c.ShouldBindQuery(&dictionary)
 	if err != nil {
 		response.FailWithMessage(err.Error(), c)
 		return

+ 1 - 1
internal/api/v1/system/sys_dictionary_detail.go

@@ -98,7 +98,7 @@ func (s *DictionaryDetailApi) UpdateSysDictionaryDetail(c *gin.Context) {
 // @Router    /sysDictionaryDetail/findSysDictionaryDetail [get]
 func (s *DictionaryDetailApi) FindSysDictionaryDetail(c *gin.Context) {
 	var detail dao.SysDictionaryDetail
-	err := c.ShouldBindJSON(&detail)
+	err := c.ShouldBindQuery(&detail)
 	if err != nil {
 		response.FailWithMessage(err.Error(), c)
 		return

+ 1 - 1
internal/api/v1/system/sys_operation_record.go

@@ -129,7 +129,7 @@ func (s *OperationRecordApi) FindSysOperationRecord(c *gin.Context) {
 // @Router    /sysOperationRecord/getSysOperationRecordList [get]
 func (s *OperationRecordApi) GetSysOperationRecordList(c *gin.Context) {
 	var pageInfo systemReq.SysOperationRecordSearch
-	err := c.ShouldBindJSON(&pageInfo)
+	err := c.ShouldBindQuery(&pageInfo)
 	if err != nil {
 		response.FailWithMessage(err.Error(), c)
 		return

BIN
smart-parking-res.syso