refactor: remove router、ioc is adjusted to inject by type

This commit is contained in:
meilin.huang
2024-12-16 23:29:18 +08:00
parent 7f2a49ba3c
commit 68f553f4b0
142 changed files with 1403 additions and 1905 deletions

View File

@@ -9,8 +9,17 @@ import (
type Common struct {
}
func (c *Common) ReqConfs() *req.Confs {
reqs := [...]*req.Conf{
// 获取公钥
req.NewGet("/public-key", c.RasPublicKey).DontNeedToken(),
}
return req.NewConfs("/common", reqs[:]...)
}
func (i *Common) RasPublicKey(rc *req.Ctx) {
publicKeyStr, err := cryptox.GetRsaPublicKey()
biz.ErrIsNilAppendErr(err, "rsa生成公私钥失败")
biz.ErrIsNilAppendErr(err, "rsa - failed to genenrate public key")
rc.ResData = publicKeyStr
}