添加generator

This commit is contained in:
liujiangtao 2020-07-25 18:05:03 +08:00
parent 9e73f6c52b
commit 09c0cc80ee
11 changed files with 242 additions and 169 deletions

View File

@ -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<String, Object> 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<String, Object> 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<String, Object> 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<String, Object> 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<String, Object> params)
{
params.put("brand_ids", brand_ids);
ProcedureResult result = dbLogicService.exec("proc_WD01D_b_brand", params);
return toAjax(result.getRes());
}
}

View File

@ -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
* <p>
* </p>
* 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);
}
}

View File

@ -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

View File

@ -1,7 +1,7 @@
# 开发环境配置 # 开发环境配置
ENV = 'development' ENV = 'development'
# 若依管理系统/开发环境 # 小象智租/开发环境
VUE_APP_BASE_API = '/dev-api' VUE_APP_BASE_API = '/dev-api'
# 路由懒加载 # 路由懒加载

View File

@ -1,5 +1,5 @@
# 生产环境配置 # 生产环境配置
ENV = 'production' ENV = 'production'
# 若依管理系统/生产环境 # 小象智租/生产环境
VUE_APP_BASE_API = '/prod-api' VUE_APP_BASE_API = '/prod-api'

View File

@ -3,5 +3,5 @@ NODE_ENV = production
# 测试环境配置 # 测试环境配置
ENV = 'staging' ENV = 'staging'
# 若依管理系统/测试环境 # 小象智租/测试环境
VUE_APP_BASE_API = '/stage-api' VUE_APP_BASE_API = '/stage-api'

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -8,13 +8,13 @@
<template v-if="device!=='mobile'"> <template v-if="device!=='mobile'">
<search id="header-search" class="right-menu-item" /> <search id="header-search" class="right-menu-item" />
<el-tooltip content="源码地址" effect="dark" placement="bottom"> <!-- <el-tooltip content="源码地址" effect="dark" placement="bottom">-->
<ruo-yi-git id="muster-git" class="right-menu-item hover-effect" /> <!-- <ruo-yi-git id="muster-git" class="right-menu-item hover-effect" />-->
</el-tooltip> <!-- </el-tooltip>-->
<el-tooltip content="文档地址" effect="dark" placement="bottom"> <!-- <el-tooltip content="文档地址" effect="dark" placement="bottom">-->
<ruo-yi-doc id="muster-doc" class="right-menu-item hover-effect" /> <!-- <ruo-yi-doc id="muster-doc" class="right-menu-item hover-effect" />-->
</el-tooltip> <!-- </el-tooltip>-->
<screenfull id="screenfull" class="right-menu-item hover-effect" /> <screenfull id="screenfull" class="right-menu-item hover-effect" />

View File

@ -26,7 +26,7 @@ export default {
}, },
data() { data() {
return { return {
title: '若依管理系统', title: '小象智租',
logo: logoImg logo: logoImg
} }
} }

View File

@ -6,7 +6,7 @@ function resolve(dir) {
return path.join(__dirname, dir) return path.join(__dirname, dir)
} }
const name = defaultSettings.title || '若依管理系统' // 标题 const name = defaultSettings.title || '小象智租' // 标题
const port = process.env.port || process.env.npm_config_port || 80 // 端口 const port = process.env.port || process.env.npm_config_port || 80 // 端口
@ -33,7 +33,7 @@ module.exports = {
proxy: { proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
target: `http://localhost:8080`, target: `http://localhost:8080/prod-api/`,
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: '' ['^' + process.env.VUE_APP_BASE_API]: ''