修复自定义Marshal序列化的BUG
This commit is contained in:
10
request.go
10
request.go
@ -38,17 +38,17 @@ func (rdl RequestDataLocation) IsValid() bool {
|
||||
// Date : 14:41 2024/11/25
|
||||
type ResponseDataLocation string
|
||||
|
||||
func (rdl ResponseDataLocation) String() string {
|
||||
return string(rdl)
|
||||
func (rdl *ResponseDataLocation) String() string {
|
||||
return string(*rdl)
|
||||
}
|
||||
|
||||
func (rdl ResponseDataLocation) MarshalJSON() ([]byte, error) {
|
||||
func (rdl *ResponseDataLocation) MarshalJSON() ([]byte, error) {
|
||||
return []byte(rdl.String()), nil
|
||||
}
|
||||
|
||||
func (rdl ResponseDataLocation) IsValid() bool {
|
||||
func (rdl *ResponseDataLocation) IsValid() bool {
|
||||
for _, item := range ResponseDataLocationList {
|
||||
if item.Value == rdl {
|
||||
if item.Value == *rdl {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user