@@ -3470,20 +3470,36 @@ func (ctl *DMSController) WebHookSendMessage(c echo.Context) error {
34703470 return NewOkResp (c )
34713471}
34723472
3473- // swagger:route GET /v1/dms/company_notice CompanyNotice GetCompanyNotice
3473+ // swagger:operation GET /v1/dms/company_notice CompanyNotice GetCompanyNotice
34743474//
34753475// get company notice info
34763476//
3477- // responses:
3478- // 200: body:GetCompanyNoticeReply
3479- // default: body:GenericResp
3477+ // ---
3478+ // parameters:
3479+ // - name: include_latest_outside_period
3480+ // description: when true, return the latest notice regardless of display window (for admin edit)
3481+ // in: query
3482+ // required: false
3483+ // type: boolean
3484+ // responses:
3485+ // '200':
3486+ // description: GetCompanyNoticeReply
3487+ // schema:
3488+ // "$ref": "#/definitions/GetCompanyNoticeReply"
3489+ // default:
3490+ // description: GenericResp
3491+ // schema:
3492+ // "$ref": "#/definitions/GenericResp"
34803493func (ctl * DMSController ) GetCompanyNotice (c echo.Context ) error {
3481- // get current user id
3494+ var req aV1.GetCompanyNoticeReq
3495+ if err := bindAndValidateReq (c , & req ); err != nil {
3496+ return NewErrResp (c , err , apiError .BadRequestErr )
3497+ }
34823498 currentUserUid , err := jwt .GetUserUidStrFromContext (c )
34833499 if err != nil {
34843500 return NewErrResp (c , err , apiError .DMSServiceErr )
34853501 }
3486- reply , err := ctl .DMS .GetCompanyNotice (c .Request ().Context (), currentUserUid )
3502+ reply , err := ctl .DMS .GetCompanyNotice (c .Request ().Context (), currentUserUid , req . IncludeLatestOutsidePeriod )
34873503 if err != nil {
34883504 return NewErrResp (c , err , apiError .APIServerErr )
34893505 }
@@ -3517,7 +3533,11 @@ func (ctl *DMSController) UpdateCompanyNotice(c echo.Context) error {
35173533 if nil != err {
35183534 return NewErrResp (c , err , apiError .BadRequestErr )
35193535 }
3520- err = ctl .DMS .UpdateCompanyNotice (c .Request ().Context (), req )
3536+ currentUserUid , err := jwt .GetUserUidStrFromContext (c )
3537+ if err != nil {
3538+ return NewErrResp (c , err , apiError .DMSServiceErr )
3539+ }
3540+ err = ctl .DMS .UpdateCompanyNotice (c .Request ().Context (), currentUserUid , req )
35213541 if err != nil {
35223542 return NewErrResp (c , err , apiError .APIServerErr )
35233543 }
0 commit comments