增加保存管理员语言选择的API

This commit is contained in:
GoEdgeLab
2023-12-12 22:40:06 +08:00
parent 154e45f9ee
commit 6b6fada202
2 changed files with 23 additions and 0 deletions

View File

@@ -740,3 +740,18 @@ func (this *AdminService) UpdateAdminTheme(ctx context.Context, req *pb.UpdateAd
}
return this.Success()
}
// UpdateAdminLang 修改管理员使用的语言
func (this *AdminService) UpdateAdminLang(ctx context.Context, req *pb.UpdateAdminLangRequest) (*pb.RPCSuccess, error) {
adminId, err := this.ValidateAdmin(ctx)
if err != nil {
return nil, err
}
var tx = this.NullTx()
err = models.SharedAdminDAO.UpdateAdminLang(tx, adminId, req.LangCode)
if err != nil {
return nil, err
}
return this.Success()
}