add
This commit is contained in:
2026-07-24 10:38:57 +08:00
parent 61f95aeedb
commit 40f6bc5bc1
4 changed files with 39 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
package flxg
import (
"context"
"encoding/json"
"errors"
"hyapi-server/internal/domains/api/dto"
"hyapi-server/internal/domains/api/services/processors"
)
// ProcessFLXLD77Request FLXLD77 API处理方法 - 劳动仲裁查询天远
func ProcessFLXLD77Request(ctx context.Context, params []byte, deps *processors.ProcessorDependencies) ([]byte, error) {
var paramsDto dto.FLXLD77Req
if err := json.Unmarshal(params, &paramsDto); err != nil {
return nil, errors.Join(processors.ErrSystem, err)
}
if err := deps.Validator.ValidateStruct(paramsDto); err != nil {
return nil, errors.Join(processors.ErrInvalidParam, err)
}
reqdata := map[string]interface{}{
"name": paramsDto.Name,
"id_card": paramsDto.IDCard,
}
respBytes, err := deps.TianyuanapiService.CallAPI(ctx, "IVYZ0S0D", reqdata)
if err != nil {
return nil, errors.Join(processors.ErrDatasource, err)
}
return respBytes, nil
}