mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-12-26 09:26:34 +08:00
refactor: remove router、ioc is adjusted to inject by type
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user