import "../base.api"

type (
    // The data of work experience information | WorkExperience信息
    WorkExperienceInfo {
        BaseIDInfo

        // employee_id | 员工ID 
        EmployeeId  *uint64 `json:"employeeId,optional"`

        // start_date | 开始时间 
        StartDate  *int64 `json:"startDate,optional"`
		StartDateStr  *string `json:"startDateStr,optional"`

        // end_date | 结束时间 
        EndDate  *int64 `json:"endDate,optional"`
		EndDateStr  *string `json:"endDateStr,optional"`

        // company | 公司名 
        Company  *string `json:"company,optional"`

        // experience | 工作内容 
        Experience  *string `json:"experience,optional"`
    }

    // The response data of work experience list | WorkExperience列表数据
    WorkExperienceListResp {
        BaseDataInfo

        // WorkExperience list data | WorkExperience列表数据
        Data WorkExperienceListInfo `json:"data"`
    }

    // WorkExperience list data | WorkExperience列表数据
    WorkExperienceListInfo {
        BaseListInfo

        // The API list data | WorkExperience列表数据
        Data  []WorkExperienceInfo  `json:"data"`
    }

    // Get work experience list request params | WorkExperience列表请求参数
    WorkExperienceListReq {
        PageInfo

        // company | 公司名 
        Company  *string `json:"company,optional"`
    }

    // WorkExperience information response | WorkExperience信息返回体
    WorkExperienceInfoResp {
        BaseDataInfo

        // WorkExperience information | WorkExperience数据
        Data WorkExperienceInfo `json:"data"`
    }
)

@server(
    jwt: Auth
    group: work_experience
    middleware: Authority
)

service Wechat {
    // Create work experience information | 创建WorkExperience
    @handler createWorkExperience
    post /work_experience/create (WorkExperienceInfo) returns (BaseMsgResp)

    // Update work experience information | 更新WorkExperience
    @handler updateWorkExperience
    post /work_experience/update (WorkExperienceInfo) returns (BaseMsgResp)

    // Delete work experience information | 删除WorkExperience信息
    @handler deleteWorkExperience
    post /work_experience/delete (IDsReq) returns (BaseMsgResp)

    // Get work experience list | 获取WorkExperience列表
    @handler getWorkExperienceList
    post /work_experience/list (WorkExperienceListReq) returns (WorkExperienceListResp)

    // Get work experience by ID | 通过ID获取WorkExperience
    @handler getWorkExperienceById
    post /work_experience (IDReq) returns (WorkExperienceInfoResp)
}
