diff --git a/muster-admin/src/main/java/com/muster/web/controller/muster/BBrandController.java b/muster-admin/src/main/java/com/muster/web/controller/muster/BBrandController.java new file mode 100644 index 000000000..205bb1379 --- /dev/null +++ b/muster-admin/src/main/java/com/muster/web/controller/muster/BBrandController.java @@ -0,0 +1,102 @@ +package com.muster.web.controller.muster; + +import com.muster.common.annotation.Log; +import com.muster.common.core.controller.BaseController; +import com.muster.common.core.domain.AjaxResult; +import com.muster.common.core.page.TableDataInfo; +import com.muster.common.enums.BusinessType; +import com.muster.logic.DbLogicService; +import com.muster.logic.model.ProcedureResult; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.HashMap; +import java.util.Map; + +/** + * 品牌Controller + * + * @author muster + * @date 2020-07-25 + */ +@RestController +@RequestMapping("/muster") +public class BBrandController extends BaseController +{ + @Autowired + private DbLogicService dbLogicService; + + /** + * 查询品牌列表 + */ + @PreAuthorize("@ss.hasPermi('WD01P')") + @GetMapping("/WD01P") + public TableDataInfo list(@RequestBody Map params) + { + ProcedureResult result = dbLogicService.exec("proc_WD01P_b_brand", params); + + return getDataTable(result.getResult()); + } + + /** + * 获取品牌详细信息 + */ + @PreAuthorize("@ss.hasPermi('WD01V')") + @GetMapping(value = "WD01V/{brand_id}") + public AjaxResult getInfo(@PathVariable("brand_id") Long brand_id) + { + Map params = new HashMap<>(); + params.put("brand_id", brand_id); + ProcedureResult result = dbLogicService.exec("proc_WD01V_b_brand", params); + + return AjaxResult.success(result.getResult()); + } + + /** + * 新增品牌 + */ + @PreAuthorize("@ss.hasPermi('WD01C')") + @Log(title = "品牌", businessType = BusinessType.INSERT) + @PostMapping("WD01C") + public AjaxResult add(@RequestBody Map params) + { + ProcedureResult result = dbLogicService.exec("proc_WD01C_b_brand", params); + + return toAjax(result.getRes()); + } + + /** + * 修改品牌 + */ + @PreAuthorize("@ss.hasPermi('WD01E')") + @Log(title = "品牌", businessType = BusinessType.UPDATE) + @PutMapping("WD01E") + public AjaxResult edit(@RequestBody Map params) + { + ProcedureResult result = dbLogicService.exec("proc_WD01E_b_brand", params); + + return toAjax(result.getRes()); + } + + /** + * 删除品牌 + */ + @PreAuthorize("@ss.hasPermi('WD01D')") + @Log(title = "品牌", businessType = BusinessType.DELETE) + @DeleteMapping("/WD01D/{brand_ids}") + public AjaxResult remove(@PathVariable Long[] brand_ids, @RequestBody Map params) + { + params.put("brand_ids", brand_ids); + ProcedureResult result = dbLogicService.exec("proc_WD01D_b_brand", params); + + return toAjax(result.getRes()); + } +} \ No newline at end of file diff --git a/muster-admin/src/main/java/com/muster/web/core/config/CorsConfig.java b/muster-admin/src/main/java/com/muster/web/core/config/CorsConfig.java new file mode 100644 index 000000000..e7d5c3e67 --- /dev/null +++ b/muster-admin/src/main/java/com/muster/web/core/config/CorsConfig.java @@ -0,0 +1,28 @@ +package com.muster.framework.config; + +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; + +/** + * Description + *

+ *

+ * DATE 2020-07-11. + * + * @author 刘江涛. + */ +@Configuration +public class CorsConfig extends WebMvcConfigurerAdapter { + + @Override + public void addCorsMappings(CorsRegistry registry) { + + registry.addMapping("/**") + .allowedOrigins("*") + .allowCredentials(true) + .allowedMethods("GET", "POST") + .maxAge(3600); + } + +} \ No newline at end of file diff --git a/muster-admin/src/main/resources/application-druid.yml b/muster-admin/src/main/resources/application-druid.yml deleted file mode 100644 index ef075d51c..000000000 --- a/muster-admin/src/main/resources/application-druid.yml +++ /dev/null @@ -1,57 +0,0 @@ -# 数据源配置 -spring: - datasource: - type: com.alibaba.druid.pool.DruidDataSource - driverClassName: com.mysql.cj.jdbc.Driver - druid: - # 主库数据源 - master: - url: jdbc:mysql://47.92.6.215:3306/muster_manager?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 - username: root - password: gywj@1qaz@WSX - # 从库数据源 - slave: - # 从数据源开关/默认关闭 - enabled: false - url: - username: - password: - # 初始连接数 - initialSize: 5 - # 最小连接池数量 - minIdle: 10 - # 最大连接池数量 - maxActive: 20 - # 配置获取连接等待超时的时间 - maxWait: 60000 - # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 - timeBetweenEvictionRunsMillis: 60000 - # 配置一个连接在池中最小生存的时间,单位是毫秒 - minEvictableIdleTimeMillis: 300000 - # 配置一个连接在池中最大生存的时间,单位是毫秒 - maxEvictableIdleTimeMillis: 900000 - # 配置检测连接是否有效 - validationQuery: SELECT 1 FROM DUAL - testWhileIdle: true - testOnBorrow: false - testOnReturn: false - webStatFilter: - enabled: true - statViewServlet: - enabled: true - # 设置白名单,不填则允许所有访问 - allow: - url-pattern: /druid/* - # 控制台管理用户名和密码 - login-username: - login-password: - filter: - stat: - enabled: true - # 慢SQL记录 - log-slow-sql: true - slow-sql-millis: 1000 - merge-sql: true - wall: - config: - multi-statement-allow: true \ No newline at end of file diff --git a/muster-ui/.env.development b/muster-ui/.env.development index 0cb1c6131..deca95f76 100644 --- a/muster-ui/.env.development +++ b/muster-ui/.env.development @@ -1,8 +1,8 @@ -# 开发环境配置 -ENV = 'development' - -# 若依管理系统/开发环境 -VUE_APP_BASE_API = '/dev-api' - -# 路由懒加载 -VUE_CLI_BABEL_TRANSPILE_MODULES = true +# 开发环境配置 +ENV = 'development' + +# 小象智租/开发环境 +VUE_APP_BASE_API = '/dev-api' + +# 路由懒加载 +VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/muster-ui/.env.production b/muster-ui/.env.production index a8e4af3b4..924b4152f 100644 --- a/muster-ui/.env.production +++ b/muster-ui/.env.production @@ -1,5 +1,5 @@ -# 生产环境配置 -ENV = 'production' - -# 若依管理系统/生产环境 -VUE_APP_BASE_API = '/prod-api' +# 生产环境配置 +ENV = 'production' + +# 小象智租/生产环境 +VUE_APP_BASE_API = '/prod-api' diff --git a/muster-ui/.env.staging b/muster-ui/.env.staging index 41d4817c4..2cd69120a 100644 --- a/muster-ui/.env.staging +++ b/muster-ui/.env.staging @@ -1,7 +1,7 @@ -NODE_ENV = production - -# 测试环境配置 -ENV = 'staging' - -# 若依管理系统/测试环境 -VUE_APP_BASE_API = '/stage-api' +NODE_ENV = production + +# 测试环境配置 +ENV = 'staging' + +# 小象智租/测试环境 +VUE_APP_BASE_API = '/stage-api' diff --git a/muster-ui/public/favicon.ico b/muster-ui/public/favicon.ico index e26376026..8676c1511 100644 Binary files a/muster-ui/public/favicon.ico and b/muster-ui/public/favicon.ico differ diff --git a/muster-ui/src/assets/logo/logo.png b/muster-ui/src/assets/logo/logo.png index e26376026..8676c1511 100644 Binary files a/muster-ui/src/assets/logo/logo.png and b/muster-ui/src/assets/logo/logo.png differ diff --git a/muster-ui/src/layout/components/Navbar.vue b/muster-ui/src/layout/components/Navbar.vue index c8d81233e..5ee2c14e4 100644 --- a/muster-ui/src/layout/components/Navbar.vue +++ b/muster-ui/src/layout/components/Navbar.vue @@ -8,13 +8,13 @@