|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- package website
-
- import (
- "applet/app/db"
- "applet/app/e"
- "applet/app/md"
- "applet/app/svc"
- "applet/app/utils"
- "applet/app/utils/cache"
- "code.fnuoos.com/EggPlanet/egg_models.git/src/implement"
- svc2 "code.fnuoos.com/EggPlanet/egg_system_rules.git/svc"
- "github.com/gin-gonic/gin"
- )
-
-
-
-
-
-
-
-
-
-
-
- func WebsiteInfo(c *gin.Context) {
- res := md.WebsiteInfoResp{
- SeoTitle: svc.GetSysCfgStr("seo_title"),
- SeoLogo: svc.GetOssUrl(svc.GetSysCfgStr("seo_logo")),
- WebLogo: svc.GetOssUrl(svc.GetSysCfgStr("web_logo")),
- AndroidDownUrl: svc.GetSysCfgStr("android_down_url"),
- IosDownUrl: svc.GetSysCfgStr("ios_down_url"),
- }
- e.OutSuc(c, res, nil)
- return
- }
-
-
-
-
-
-
-
-
-
-
-
-
- func GetModuleSetting(c *gin.Context) {
- modName := c.Query("mod_name_value")
- modNameMap := map[string]string{
- "15": "website_about_us",
- }
- val, ok := modNameMap[modName]
- if !ok {
- e.OutErr(c, e.ERR_BAD_REQUEST, nil)
- return
- }
- moduleStyleDb := implement.NewModuleStyleDb(db.Db)
- moduleStyle, err := moduleStyleDb.ModuleStyleGetOneByParams(map[string]interface{}{
- "key": "mod_name",
- "value": val,
- })
- if err != nil {
- e.OutErr(c, e.ERR_DB_ORM, err.Error())
- return
- }
- if moduleStyle == nil {
- e.OutErr(c, e.ERR_NO_DATA, nil)
- return
- }
- var dataMap interface{}
- redisConn := cache.GetPool().Get()
- scheme, domain := svc2.ImageBucket(db.Db, redisConn)
- moduleStyle.Data = svc2.ImageFormatWithBucketForDataInfo(scheme, domain, moduleStyle.Data)
- utils.Unserialize([]byte(moduleStyle.Data), &dataMap)
- resp := md.GetModuleSettingResp{
- ModName: moduleStyle.ModName,
- Position: moduleStyle.Position,
- SkipIdentifier: moduleStyle.SkipIdentifier,
- Title: moduleStyle.Title,
- Subtitle: moduleStyle.Subtitle,
- Data: dataMap,
- }
- e.OutSuc(c, resp, nil)
- }
|