Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 增加假期相关接口及时长组件补充时区信息 #196

Merged
merged 2 commits into from
Mar 8, 2024

Conversation

@yoogoc yoogoc force-pushed the develop branch 2 times, most recently from 6f8f2fd to 0856708 Compare February 27, 2024 06:11
oa.go Outdated Show resolved Hide resolved
@yoogoc yoogoc changed the title feat: 增加假期相关接口 feat: 增加假期相关接口及时长组件补充时区信息 Mar 7, 2024
@xen0n
Copy link
Owner

xen0n commented Mar 7, 2024

Error: S1016: should convert req (type SetOAOneUserVacationQuota) to reqOASetOneUserVacationQuota instead of using struct literal (gosimple)

似乎有个结构体类型转换可以简化,否则 lint 过不了

@yoogoc yoogoc force-pushed the develop branch 2 times, most recently from 9107d12 to aeccff7 Compare March 7, 2024 10:05
@yoogoc
Copy link
Contributor Author

yoogoc commented Mar 7, 2024

Error: S1016: should convert req (type SetOAOneUserVacationQuota) to reqOASetOneUserVacationQuota instead of using struct literal (gosimple)

似乎有个结构体类型转换可以简化,否则 lint 过不了

updated

oa.go Outdated
}

// SetOAOneUserVacationQuota 修改成员假期余额
func (c *WorkwxApp) SetOAOneUserVacationQuota(userID, vacationID, leftDuration, remarks string, timeAttr int64) error {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

啊,不是这个意思。你可以保留先前的公有结构体,但在下边可以直接 cast 到内部 req 类型

func (c *WorkwxApp) OASetOneUserVacationQuota(req *ReqOASOneUserVacationQuota) error {
    _, err := c.execOASetOneUserVacationQuota(reqOASetOneUserVacationQuota(*req))
    return err
}

Copy link
Owner

@xen0n xen0n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

然后你可能要把所有 OA 字样不位于最前方的方法名都改一下。由于目前所有接口定义都堆在同一个类型上,按前缀区分大的功能模块会比较易于理解。例如 SetOA* 应为 OASet*

@yoogoc
Copy link
Contributor Author

yoogoc commented Mar 7, 2024

然后你可能要把所有 OA 字样不位于最前方的方法名都改一下。由于目前所有接口定义都堆在同一个类型上,按前缀区分大的功能模块会比较易于理解。例如 SetOA* 应为 OASet*

您的意思是把诸如GetOATemplateDetail改成OAGetTemplateDetail么?这样有破坏性改动不要紧的么?

@xen0n
Copy link
Owner

xen0n commented Mar 7, 2024

然后你可能要把所有 OA 字样不位于最前方的方法名都改一下。由于目前所有接口定义都堆在同一个类型上,按前缀区分大的功能模块会比较易于理解。例如 SetOA* 应为 OASet*

您的意思是把诸如GetOATemplateDetail改成OAGetTemplateDetail么?这样有破坏性改动不要紧的么?

啊,历史上就有不一致的用法了吗,那你看哪种用法多就用哪种

我后边加一堆兼容的名字,然后 deprecate 掉旧的写法,v2 删除,这样应该能比较平滑地迁移了

@yoogoc
Copy link
Contributor Author

yoogoc commented Mar 8, 2024

然后你可能要把所有 OA 字样不位于最前方的方法名都改一下。由于目前所有接口定义都堆在同一个类型上,按前缀区分大的功能模块会比较易于理解。例如 SetOA* 应为 OASet*

您的意思是把诸如GetOATemplateDetail改成OAGetTemplateDetail么?这样有破坏性改动不要紧的么?

啊,历史上就有不一致的用法了吗,那你看哪种用法多就用哪种

我后边加一堆兼容的名字,然后 deprecate 掉旧的写法,v2 删除,这样应该能比较平滑地迁移了

目前看来是*OA*用法比较多,我先用这种方式了,后续有需要的话,我可以协助您修改

@yoogoc yoogoc requested a review from xen0n March 8, 2024 09:50
Copy link
Owner

@xen0n xen0n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@xen0n xen0n merged commit 1d24b34 into xen0n:develop Mar 8, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants