add cms, fsagent module
This commit is contained in:
parent
98d7a5d51e
commit
94ce781ba6
309
README.md
Normal file
309
README.md
Normal file
@ -0,0 +1,309 @@
|
|||||||
|
# Corona
|
||||||
|
|
||||||
|
### IDEA 环境需求
|
||||||
|
|
||||||
|
由于项目依赖`org.projectlombok:lombok:1.18.2`,而`Lombok`在`1.18.4`版本做了[重设计](https://projectlombok.org/features/experimental/FieldNameConstants),不兼容之前版本,因此`IDEA`的`Lombok`插件必须是版本`lombok-plugin-0.23`,这里比较坑,如果升级到版本`1.18.4`以后,插件还是得升级,而且很多API都要改。
|
||||||
|
|
||||||
|
插件下载地址:[https://pan.caimi-inc.com/d/b038610394/](https://pan.caimi-inc.com/d/b038610394/)
|
||||||
|
|
||||||
|
下载对应版本插件,比如`IDEA 2018.2.x`下载`lombok-plugin-0.23-2018.2.zip`,卸载`IDEA`已安装`Lombok`插件,选择磁盘安装,如下图:
|
||||||
|

|
||||||
|
|
||||||
|
### 启动SpringBoot项目
|
||||||
|
|
||||||
|
建议先执行mvn编译命令,比如编译模块`CMS`
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mvn clean compile -am -pl cms -T 2C
|
||||||
|
```
|
||||||
|
|
||||||
|
### Tigon
|
||||||
|
|
||||||
|
#### Controller
|
||||||
|
|
||||||
|
如果加注了`@ResponseBody`或者`@RestController`,不做变动,依循`Spring MVC`方式`JSON`序列化返回数据,否则返回`Wacai`接口规范数据格式,如下例:
|
||||||
|
|
||||||
|
#### @ResponseBody
|
||||||
|
|
||||||
|
```java
|
||||||
|
@ResponseBody
|
||||||
|
@RequestMapping("/resp-body")
|
||||||
|
public String respBody() {
|
||||||
|
return "Response Body";
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
响应输出
|
||||||
|
|
||||||
|
```
|
||||||
|
Response Body
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Wacai JSON API
|
||||||
|
|
||||||
|
```java
|
||||||
|
@RequestMapping("/resp-body")
|
||||||
|
public String respBody() {
|
||||||
|
return "Response Body";
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
响应输出
|
||||||
|
|
||||||
|
```
|
||||||
|
{
|
||||||
|
"code": 0,
|
||||||
|
"success": true,
|
||||||
|
"data": "Response Body"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
简单来说就是,不加`@ResponseBody`注解,默认会以`Wacai`API规范响应数据结果。
|
||||||
|
|
||||||
|
参见以下样例:
|
||||||
|
|
||||||
|
I.
|
||||||
|
|
||||||
|
```java
|
||||||
|
@RequestMapping("/count")
|
||||||
|
public int count() {
|
||||||
|
return 1024;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
响应输出
|
||||||
|
|
||||||
|
```
|
||||||
|
{
|
||||||
|
"code": 0,
|
||||||
|
"success": true,
|
||||||
|
"data": 1024
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
II.
|
||||||
|
|
||||||
|
```java
|
||||||
|
@RequestMapping("/user-info")
|
||||||
|
public Map<String, Object> userInfo() {
|
||||||
|
final Map<String, Object> user = new HashMap<>(4);
|
||||||
|
user.put("name", "Uncle Donghuang");
|
||||||
|
user.put("gender", "MALE");
|
||||||
|
user.put("mobile", "17161787481");
|
||||||
|
user.put("active", true);
|
||||||
|
return user;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
响应输出
|
||||||
|
|
||||||
|
```
|
||||||
|
{
|
||||||
|
"code": 0,
|
||||||
|
"success": true,
|
||||||
|
"data": {
|
||||||
|
"name": "Uncle Donghuang",
|
||||||
|
"gender": "MALE",
|
||||||
|
"mobile": "17161787481",
|
||||||
|
"active": true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
III.
|
||||||
|
|
||||||
|
```java
|
||||||
|
@RequestMapping("/error-caused")
|
||||||
|
public Map<String, Object> errorCaused() {
|
||||||
|
throw new RuntimeException("Oops, some error caused");
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
响应输出
|
||||||
|
|
||||||
|
```
|
||||||
|
{
|
||||||
|
"code": 5000,
|
||||||
|
"success": false,
|
||||||
|
"message": "Oops, some error caused"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### MyBatis
|
||||||
|
|
||||||
|
`MyBatis`做了启动期增强,实例`Mapper`继承了`BaseMapper`之后,会继承获得相关的增删改查等方法,如下例:
|
||||||
|
|
||||||
|
##### Model
|
||||||
|
|
||||||
|
```java
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.wacai.tigon.model.M0;
|
||||||
|
import com.wacai.tigon.mybatis.Table;
|
||||||
|
import com.wacai.tigon.mybatis.NotUpdate;
|
||||||
|
import lombok.experimental.FieldNameConstants;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Table("yo_customer")
|
||||||
|
@FieldNameConstants(prefix = "")
|
||||||
|
public class Customer extends M0<Integer> {
|
||||||
|
private String name;
|
||||||
|
private String account;
|
||||||
|
private String password;
|
||||||
|
private String note;
|
||||||
|
@NotUpdate
|
||||||
|
protected Date createdTime;
|
||||||
|
protected Date updatedTime;
|
||||||
|
@NotUpdate
|
||||||
|
protected String createdBy;
|
||||||
|
protected String updatedBy;
|
||||||
|
protected boolean active;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Mapper
|
||||||
|
|
||||||
|
```java
|
||||||
|
import com.wacai.tigon.mybatis.BaseMapper;
|
||||||
|
|
||||||
|
public interface CustomerMapper extends BaseMapper<Integer, Customer> {
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Mapper.xml
|
||||||
|
```xml
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.wacai.loan.yo.mapper.CustomerMapper">
|
||||||
|
</mapper>
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Usage
|
||||||
|
|
||||||
|
```java
|
||||||
|
@Autowired
|
||||||
|
private CustomerMapper customerMapper;
|
||||||
|
```
|
||||||
|
|
||||||
|
I. 插入
|
||||||
|
|
||||||
|
```java
|
||||||
|
final Customer customer = new Customer();
|
||||||
|
customer.setName("Uncle Donghuang");
|
||||||
|
customer.setAccount("donghuang");
|
||||||
|
customer.setPassword("qR$#FzM!z9W*");
|
||||||
|
customer.setCreatedBy("SYS");
|
||||||
|
customer.setCreatedTime(new Date());
|
||||||
|
customer.setActive(true);
|
||||||
|
customerMapper.insert(customer);
|
||||||
|
```
|
||||||
|
|
||||||
|
II. 查询
|
||||||
|
|
||||||
|
Find by ID
|
||||||
|
|
||||||
|
```java
|
||||||
|
final Integer id = 1154;
|
||||||
|
final Customer customer = customerMapper.find(id);
|
||||||
|
```
|
||||||
|
|
||||||
|
Find by `Search`
|
||||||
|
|
||||||
|
```java
|
||||||
|
final Customer customer = customerMapper.find(
|
||||||
|
new Search(Customer.ACCOUNT, "donghuang")
|
||||||
|
.eq(Customer.ACTIVE, true));
|
||||||
|
```
|
||||||
|
|
||||||
|
List by `Search`
|
||||||
|
|
||||||
|
```java
|
||||||
|
final List<Customer> customers = customerMapper.list(
|
||||||
|
new Search(Customer.ACTIVE, true)
|
||||||
|
.between(Customer.ID, 1, 1154)
|
||||||
|
.asc(Customer.ACCOUNT)
|
||||||
|
.limit(42));
|
||||||
|
```
|
||||||
|
|
||||||
|
`Search` API
|
||||||
|
|
||||||
|
- `and` And another `Search`
|
||||||
|
- `asc` Order ASC
|
||||||
|
- `between` Between two values
|
||||||
|
- `contains` Value contains string
|
||||||
|
- `desc` Order DSC
|
||||||
|
- `endsWith` Value ends with string
|
||||||
|
- `eq` Eqauls
|
||||||
|
- `gt` Greater than
|
||||||
|
- `gte` Eqauls or greater than
|
||||||
|
- `in` In values
|
||||||
|
- `isNull` Value is null
|
||||||
|
- `like` Value like
|
||||||
|
- `limit` Return rows limit
|
||||||
|
- `lt` Less than
|
||||||
|
- `lte` Eqauls or less than
|
||||||
|
- `ne` Not equals
|
||||||
|
- `notIn` Not in values
|
||||||
|
- `notNull` Value is not null
|
||||||
|
- `offset` Return rows offset
|
||||||
|
- `or` Or another `Search`
|
||||||
|
- `orderBy` Order by
|
||||||
|
- `startsWith` Value starts with string
|
||||||
|
|
||||||
|
III. 更新
|
||||||
|
|
||||||
|
Update model
|
||||||
|
|
||||||
|
```java
|
||||||
|
Customer customer = customerMapper.find(
|
||||||
|
new Search(Customer.ACCOUNT, "donghuang")
|
||||||
|
.eq(Customer.ACTIVE, true));
|
||||||
|
|
||||||
|
customer.setPassword("g!5KpWdXEB!^");
|
||||||
|
customer.setUpdatedBy("SYS");
|
||||||
|
customer.setUpdatedTime(new Date());
|
||||||
|
customerMapper.update(customer);
|
||||||
|
```
|
||||||
|
|
||||||
|
Update with map
|
||||||
|
|
||||||
|
```java
|
||||||
|
final Map<String, Object> update = new HashMap<>(4);
|
||||||
|
update.put(Customer.PASSWORD, "g!5KpWdXEB!^");
|
||||||
|
update.put(Customer.UPDATED_BY, "SYS");
|
||||||
|
update.put(Customer.UPDATED_TIME, new Date());
|
||||||
|
|
||||||
|
customerMapper.update(update, 1154);
|
||||||
|
// OR
|
||||||
|
// customerMapper.update(update, new Search(Customer.ID, 1154));
|
||||||
|
```
|
||||||
|
|
||||||
|
Set null
|
||||||
|
|
||||||
|
```java
|
||||||
|
// Update note to null of customer 1154
|
||||||
|
customerMapper.setNull(Customer.NOTE, 1154);
|
||||||
|
// Update note to null of customer 1154
|
||||||
|
customerMapper.setNull(Customer.NOTE, new Search(Customer.ID, 1154));
|
||||||
|
// Update note to null of all
|
||||||
|
customerMapper.setNull(Customer.NOTE, new Search());
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
IV. 删除
|
||||||
|
|
||||||
|
Delete by ID
|
||||||
|
|
||||||
|
```java
|
||||||
|
customerMapper.delete(1154);
|
||||||
|
```
|
||||||
|
|
||||||
|
Delete by `Search`
|
||||||
|
|
||||||
|
```java
|
||||||
|
customerMapper.delete(new Search(Customer.ID, 1154));
|
||||||
|
```
|
||||||
|
|
1
cms/README.md
Normal file
1
cms/README.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
# Yo BR CMS
|
Binary file not shown.
127
cms/pom.xml
Normal file
127
cms/pom.xml
Normal file
@ -0,0 +1,127 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
|
||||||
|
http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<artifactId>yo-cms</artifactId>
|
||||||
|
<version>0.0.1-RELEASE</version>
|
||||||
|
<name>Yo CMS</name>
|
||||||
|
<description>Yo CMS</description>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<groupId>com.pudonghot.yo</groupId>
|
||||||
|
<artifactId>yo</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
<relativePath>../</relativePath>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<spring-boot.run.main-class>com.pudonghot.yo.cms.YoCMS</spring-boot.run.main-class>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.pudonghot.yo</groupId>
|
||||||
|
<artifactId>yo-cms-web</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
<scope>system</scope>
|
||||||
|
<systemPath>${project.basedir}/local-repo/com/pudonghot/yo/yo-cms-web/0.0.1-SNAPSHOT/yo-cms-web-0.0.1-SNAPSHOT.jar</systemPath>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.pudonghot.yo</groupId>
|
||||||
|
<artifactId>yo-openapi-dto</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.github.openfeign</groupId>
|
||||||
|
<artifactId>feign-httpclient</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.github.openfeign</groupId>
|
||||||
|
<artifactId>feign-jackson</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.pudonghot.yo</groupId>
|
||||||
|
<artifactId>yo-mapper</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.pudonghot.yo</groupId>
|
||||||
|
<artifactId>yo-redis-raw</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.pudonghot.yo</groupId>
|
||||||
|
<artifactId>yo-util</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.pudonghot.yo</groupId>
|
||||||
|
<artifactId>yo-cellphone-location</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.pudonghot.yo</groupId>
|
||||||
|
<artifactId>yo-http-client-apache</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.wacai.tigon</groupId>
|
||||||
|
<artifactId>tigon-shiro-cas</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.pudonghot.yo</groupId>
|
||||||
|
<artifactId>yo-shiro-cache</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.wacai.tigon</groupId>
|
||||||
|
<artifactId>tigon-common</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.wacai.tigon</groupId>
|
||||||
|
<artifactId>tigon-service-support</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.pudonghot.yo</groupId>
|
||||||
|
<artifactId>yo-web-common</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.wacai.tigon</groupId>
|
||||||
|
<artifactId>tigon-web-controller</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<!-- Provided Dependencies -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Test Dependencies -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<skip>false</skip>
|
||||||
|
<fork>true</fork>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>pl.project13.maven</groupId>
|
||||||
|
<artifactId>git-commit-id-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
51
cms/src/main/java/com/pudonghot/yo/cms/YoCMS.java
Normal file
51
cms/src/main/java/com/pudonghot/yo/cms/YoCMS.java
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
package com.pudonghot.yo.cms;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
import org.springframework.http.CacheControl;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
|
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Oct 26, 2019 15:56:08
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@EnableFeignClients
|
||||||
|
@SpringBootApplication
|
||||||
|
public class YoCMS implements WebMvcConfigurer {
|
||||||
|
|
||||||
|
@Value("${site.context-path:}")
|
||||||
|
private String siteContextPath;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* main
|
||||||
|
* @param args args
|
||||||
|
*/
|
||||||
|
public static void main(final String[] args) {
|
||||||
|
SpringApplication.run(YoCMS.class, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void addResourceHandlers(final ResourceHandlerRegistry registry) {
|
||||||
|
// Assets
|
||||||
|
final String assetsPattern = "/assets/**";
|
||||||
|
final String resourceLocation = "classpath:/yo-cms/assets/";
|
||||||
|
log.info("Add resource handler [{}] -> [{}].", assetsPattern, resourceLocation);
|
||||||
|
|
||||||
|
registry.addResourceHandler(
|
||||||
|
StringUtils.hasText(siteContextPath) ?
|
||||||
|
siteContextPath + assetsPattern :
|
||||||
|
assetsPattern)
|
||||||
|
.addResourceLocations(resourceLocation)
|
||||||
|
.setCacheControl(CacheControl.maxAge(42, TimeUnit.DAYS));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package com.pudonghot.yo.cms.annotation;
|
||||||
|
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 17, 2019 16:51:56
|
||||||
|
*/
|
||||||
|
@Target({ElementType.TYPE})
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
public @interface Taggable {
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package com.pudonghot.yo.cms.annotation;
|
||||||
|
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mark resource is part of tenant
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 04, 2019 23:06:46
|
||||||
|
*/
|
||||||
|
@Target({ElementType.TYPE})
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
public @interface TenantResource {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* search attr
|
||||||
|
* @return true if set search attr
|
||||||
|
*/
|
||||||
|
boolean searchAttr() default false;
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
package com.pudonghot.yo.cms.auth;
|
||||||
|
|
||||||
|
import javax.servlet.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.core.annotation.Order;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 17, 2019 16:30:41
|
||||||
|
*/
|
||||||
|
@Order
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class AuthRequestFilter implements Filter {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
|
||||||
|
log.debug("Wrap HTTP servlet request as AUTH request.");
|
||||||
|
filterChain.doFilter(new AuthRequestWrapper((HttpServletRequest) servletRequest), servletResponse);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,68 @@
|
|||||||
|
package com.pudonghot.yo.cms.auth;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.BasicForm;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequestWrapper;
|
||||||
|
import com.pudonghot.yo.model.domain.BaseDomain;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 17, 2019 16:05:39
|
||||||
|
*/
|
||||||
|
public class AuthRequestWrapper extends HttpServletRequestWrapper implements SessionAbility {
|
||||||
|
private static Map<String, Function<SessionAbility, ?>> AUTH_ELS = new HashMap<>();
|
||||||
|
static {
|
||||||
|
AUTH_ELS.put(BasicForm.TENANT_ID, SessionAbility::getTenantId);
|
||||||
|
AUTH_ELS.put(BasicForm.TENANT_CODE, SessionAbility::getTenantCode);
|
||||||
|
AUTH_ELS.put(BasicForm.AUTH_USER, SessionAbility::getUserAccount);
|
||||||
|
AUTH_ELS.put(BaseDomain.CREATED_BY, SessionAbility::getUserAccount);
|
||||||
|
AUTH_ELS.put(BaseDomain.UPDATED_BY, SessionAbility::getUserAccount);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
public AuthRequestWrapper(final HttpServletRequest request) {
|
||||||
|
super(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Enumeration<String> getParameterNames() {
|
||||||
|
final Enumeration<String> paramNames = super.getParameterNames();
|
||||||
|
|
||||||
|
if (isAuthenticated()) {
|
||||||
|
final List<String> params = Collections.list(paramNames);
|
||||||
|
params.addAll(AUTH_ELS.keySet());
|
||||||
|
return Collections.enumeration(params);
|
||||||
|
}
|
||||||
|
return paramNames;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String[] getParameterValues(final String name) {
|
||||||
|
final Function<SessionAbility, ?> getter = AUTH_ELS.get(name);
|
||||||
|
return getter != null ? new String[] { getParam(getter) } : super.getParameterValues(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get params
|
||||||
|
* @param getter getter
|
||||||
|
* @return param string or null
|
||||||
|
*/
|
||||||
|
private String getParam(final Function<SessionAbility, ?> getter) {
|
||||||
|
final Object param = getter.apply(this);
|
||||||
|
return param != null ?
|
||||||
|
(param instanceof String ?
|
||||||
|
(String) param : String.valueOf(param)) : null;
|
||||||
|
}
|
||||||
|
}
|
108
cms/src/main/java/com/pudonghot/yo/cms/auth/SessionAbility.java
Normal file
108
cms/src/main/java/com/pudonghot/yo/cms/auth/SessionAbility.java
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
package com.pudonghot.yo.cms.auth;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
import com.wacai.tigon.mybatis.Search;
|
||||||
|
import org.apache.shiro.SecurityUtils;
|
||||||
|
import org.springframework.util.Assert;
|
||||||
|
import io.buji.pac4j.subject.Pac4jPrincipal;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import com.pudonghot.yo.model.ValueTextModel;
|
||||||
|
import com.pudonghot.yo.model.domain.Tenant;
|
||||||
|
import com.pudonghot.yo.cms.service.TenantService;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Sep 11, 2019 17:03:44
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
public interface SessionAbility {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get tenant id
|
||||||
|
* @return tenant code
|
||||||
|
*/
|
||||||
|
default Integer getTenantId() {
|
||||||
|
return getTenant(getUserAccount()).getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get tenant code
|
||||||
|
* @return tenant code
|
||||||
|
*/
|
||||||
|
default String getTenantCode() {
|
||||||
|
return getTenant(getUserAccount()).getCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get current user tenant
|
||||||
|
* @return current user tenant
|
||||||
|
*/
|
||||||
|
default Tenant getTenant() {
|
||||||
|
return getTenant(getUserAccount());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get account tenant
|
||||||
|
* @param account account
|
||||||
|
* @return tenant of account
|
||||||
|
*/
|
||||||
|
default Tenant getTenant(final String account) {
|
||||||
|
final TenantService tenantService =
|
||||||
|
SessionServiceHolder.getTenantService();
|
||||||
|
final ValueTextModel<String> tenantVt =
|
||||||
|
tenantService.current(account);
|
||||||
|
Assert.state(tenantVt != null, "没有选择租户");
|
||||||
|
final Tenant tenant = tenantService.find(
|
||||||
|
new Search(Tenant.CODE, tenantVt.getValue())
|
||||||
|
.eq(Tenant.ACTIVE, true));
|
||||||
|
Assert.state(tenant != null, "无效租户");
|
||||||
|
return tenant;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get auth user account
|
||||||
|
* @return user account
|
||||||
|
*/
|
||||||
|
default String getUserAccount() {
|
||||||
|
final Pac4jPrincipal principal =
|
||||||
|
(Pac4jPrincipal) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
// extract email account
|
||||||
|
return principal.getProfile().getId().replaceAll("@.+$", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* return current auth user permissions
|
||||||
|
*/
|
||||||
|
default Set<String> getPermissions() {
|
||||||
|
final Pac4jPrincipal principal =
|
||||||
|
(Pac4jPrincipal) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
return principal.getProfile().getPermissions();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* return current auth user roles
|
||||||
|
* @return current auth user roles
|
||||||
|
*/
|
||||||
|
default Set<String> getRoles() {
|
||||||
|
final Pac4jPrincipal principal =
|
||||||
|
(Pac4jPrincipal) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
return principal.getProfile().getRoles();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* login user name
|
||||||
|
* @return login user name
|
||||||
|
*/
|
||||||
|
default String getUsername() {
|
||||||
|
return StringUtils.capitalize(getUserAccount());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* return true if user is authenticated
|
||||||
|
* @return true if user is authenticated
|
||||||
|
*/
|
||||||
|
default boolean isAuthenticated() {
|
||||||
|
return SecurityUtils.getSubject().isAuthenticated();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package com.pudonghot.yo.cms.auth;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import com.pudonghot.yo.cms.service.TenantService;
|
||||||
|
import org.springframework.beans.factory.InitializingBean;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Sep 11, 2019 16:57:24
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Component
|
||||||
|
@RequiredArgsConstructor(onConstructor_ = {@Autowired})
|
||||||
|
public class SessionServiceHolder implements InitializingBean {
|
||||||
|
private static SessionServiceHolder holder;
|
||||||
|
|
||||||
|
private final TenantService tenantService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void afterPropertiesSet() {
|
||||||
|
holder = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TenantService getTenantService() {
|
||||||
|
return holder.tenantService;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,79 @@
|
|||||||
|
package com.pudonghot.yo.cms.controller;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.auth.SessionAbility;
|
||||||
|
import com.pudonghot.yo.cms.form.create.CreateFormAgent;
|
||||||
|
import com.pudonghot.yo.cms.form.update.UpdateFormAgent;
|
||||||
|
import com.pudonghot.yo.cms.service.AgentGroupService;
|
||||||
|
import com.wacai.tigon.form.FormList;
|
||||||
|
import com.wacai.tigon.mybatis.Search;
|
||||||
|
import com.wacai.tigon.model.ViewModel;
|
||||||
|
import com.pudonghot.yo.model.domain.Queue;
|
||||||
|
import com.pudonghot.yo.model.domain.Agent;
|
||||||
|
import com.wacai.tigon.web.controller.ArgQuery;
|
||||||
|
import com.wacai.tigon.web.annotation.ListApi;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import com.pudonghot.yo.model.domain.AgentGroup;
|
||||||
|
import com.wacai.tigon.web.annotation.FilterCol;
|
||||||
|
import com.pudonghot.yo.cms.annotation.Taggable;
|
||||||
|
import com.pudonghot.yo.cms.service.QueueService;
|
||||||
|
import com.wacai.tigon.web.controller.BaseCrudController;
|
||||||
|
import com.pudonghot.yo.cms.annotation.TenantResource;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 02, 2019 13:46:16
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@ListApi(searchCols = {
|
||||||
|
Agent.NAME,
|
||||||
|
Agent.ACCOUNT,
|
||||||
|
Agent.AGENT,
|
||||||
|
Agent.NOTE
|
||||||
|
},
|
||||||
|
filterCols = {
|
||||||
|
@FilterCol(param = Agent.ACTIVE, type = boolean.class),
|
||||||
|
@FilterCol(param = Agent.GROUP_ID, type = Integer.class),
|
||||||
|
@FilterCol(param = Agent.TYPE, type = Agent.Type.class),
|
||||||
|
@FilterCol(param = Agent.WEBRTC, type = boolean.class),
|
||||||
|
@FilterCol(param = Agent.TAGS, type = Integer.class, searchAttr = true),
|
||||||
|
@FilterCol(param = Agent.QUEUES, type = Integer.class, searchAttr = true)
|
||||||
|
})
|
||||||
|
@Taggable
|
||||||
|
@TenantResource
|
||||||
|
@RequestMapping("/agent")
|
||||||
|
public class AgentController
|
||||||
|
extends BaseCrudController<Integer,
|
||||||
|
Agent,
|
||||||
|
FormList,
|
||||||
|
CreateFormAgent,
|
||||||
|
UpdateFormAgent> implements SessionAbility {
|
||||||
|
@Autowired
|
||||||
|
private AgentGroupService agentGroupService;
|
||||||
|
@Autowired
|
||||||
|
private QueueService queueService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void before(final ArgQuery<?> arg) {
|
||||||
|
super.before(arg);
|
||||||
|
arg.getSearch().attr("withQueues", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void after(final ArgQuery<?> arg) {
|
||||||
|
super.after(arg);
|
||||||
|
final ViewModel<?> model = arg.getResult();
|
||||||
|
final Integer tenantId = getTenantId();
|
||||||
|
model.setAttr("groupsList", agentGroupService.list(
|
||||||
|
new Search(AgentGroup.TENANT_ID, tenantId)));
|
||||||
|
model.setAttr("queuesList", queueService.list(
|
||||||
|
new Search(Queue.TENANT_ID, tenantId)));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,74 @@
|
|||||||
|
package com.pudonghot.yo.cms.controller;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.auth.SessionAbility;
|
||||||
|
import com.pudonghot.yo.cms.form.create.CreateFormAgentGroup;
|
||||||
|
import com.wacai.tigon.form.FormList;
|
||||||
|
import com.wacai.tigon.mybatis.Search;
|
||||||
|
import com.wacai.tigon.web.controller.ArgQuery;
|
||||||
|
import com.wacai.tigon.web.annotation.ListApi;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import com.wacai.tigon.web.annotation.FilterCol;
|
||||||
|
import com.pudonghot.yo.model.domain.AgentGroup;
|
||||||
|
import com.pudonghot.yo.cms.annotation.Taggable;
|
||||||
|
import com.pudonghot.yo.model.domain.TrunkStrategy;
|
||||||
|
import com.wacai.tigon.web.controller.BaseCrudController;
|
||||||
|
import com.pudonghot.yo.cms.annotation.TenantResource;
|
||||||
|
import com.pudonghot.yo.cms.service.TrunkStrategyService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import com.pudonghot.yo.cms.form.update.UpdateFormAgentGroup;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 02, 2019 13:46:16
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@ListApi(searchCols = {
|
||||||
|
AgentGroup.NAME,
|
||||||
|
AgentGroup.NOTE
|
||||||
|
},
|
||||||
|
filterCols = {
|
||||||
|
@FilterCol(param = AgentGroup.ACTIVE, type = boolean.class),
|
||||||
|
@FilterCol(param = AgentGroup.PRIVACY_LEVEL, type = String.class),
|
||||||
|
@FilterCol(param = AgentGroup.TRUNK_STRATEGIES, type = Integer.class, searchAttr = true),
|
||||||
|
@FilterCol(param = AgentGroup.TAGS, type = Integer.class, searchAttr = true)
|
||||||
|
})
|
||||||
|
@Taggable
|
||||||
|
@TenantResource
|
||||||
|
@RequestMapping("/agent-group")
|
||||||
|
public class AgentGroupController
|
||||||
|
extends BaseCrudController<Integer,
|
||||||
|
AgentGroup,
|
||||||
|
FormList,
|
||||||
|
CreateFormAgentGroup,
|
||||||
|
UpdateFormAgentGroup> implements SessionAbility {
|
||||||
|
@Autowired
|
||||||
|
private TrunkStrategyService trunkStrategyService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void before(final ArgQuery<?> arg) {
|
||||||
|
super.before(arg);
|
||||||
|
arg.getSearch().attr("withTrunkStrategies", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void after(final ArgQuery<?> arg) {
|
||||||
|
super.after(arg);
|
||||||
|
arg.getResult().attr("trunkStrategiesList",
|
||||||
|
trunkStrategyService.list(
|
||||||
|
new Search(TrunkStrategy.TENANT_ID, getTenantId())));
|
||||||
|
arg.getResult().attr("privacyLevelsList", AgentGroup.PrivacyLevel.values());
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/privacyLevelsList")
|
||||||
|
public AgentGroup.PrivacyLevel[] privacyLevelsList(){
|
||||||
|
return AgentGroup.PrivacyLevel.values();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,42 @@
|
|||||||
|
package com.pudonghot.yo.cms.controller;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.auth.SessionAbility;
|
||||||
|
import com.pudonghot.yo.cms.form.create.CreateFormAreaCode;
|
||||||
|
import com.pudonghot.yo.cms.form.update.UpdateFormAreaCode;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import com.wacai.tigon.form.FormList;
|
||||||
|
import com.wacai.tigon.web.annotation.ListApi;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import com.pudonghot.yo.model.domain.AreaCode;
|
||||||
|
import com.wacai.tigon.web.annotation.FilterCol;
|
||||||
|
import com.pudonghot.yo.cms.annotation.Taggable;
|
||||||
|
import com.wacai.tigon.web.controller.BaseCrudController;
|
||||||
|
import com.pudonghot.yo.cms.annotation.TenantResource;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Area code is public, has no tenant, @TenantResource on search attr
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Jan 09, 2018 19:32:00
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Controller
|
||||||
|
@ListApi(searchCols = {
|
||||||
|
AreaCode.CODE,
|
||||||
|
AreaCode.CITY,
|
||||||
|
AreaCode.NOTE
|
||||||
|
},
|
||||||
|
filterCols = {
|
||||||
|
@FilterCol(param = AreaCode.TAGS, type = Integer.class, searchAttr = true)
|
||||||
|
})
|
||||||
|
@Taggable
|
||||||
|
@TenantResource(searchAttr = true)
|
||||||
|
@RequestMapping("/area-code")
|
||||||
|
public class AreaCodeController
|
||||||
|
extends BaseCrudController<Integer,
|
||||||
|
AreaCode,
|
||||||
|
FormList,
|
||||||
|
CreateFormAreaCode,
|
||||||
|
UpdateFormAreaCode>
|
||||||
|
implements SessionAbility {
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.pudonghot.yo.cms.controller;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.auth.SessionAbility;
|
||||||
|
import com.wacai.tigon.mybatis.Search;
|
||||||
|
import org.springframework.util.Assert;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import com.pudonghot.yo.model.domain.AuthUser;
|
||||||
|
import com.pudonghot.yo.cms.service.TenantService;
|
||||||
|
import com.pudonghot.yo.cms.service.AuthUserService;
|
||||||
|
import com.pudonghot.yo.cms.service.AuthRoleService;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import com.pudonghot.yo.cms.service.AuthPermissionService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Mar 14, 2017 14:59:22
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
public class AuthController implements SessionAbility {
|
||||||
|
@Autowired
|
||||||
|
private TenantService tenantService;
|
||||||
|
@Autowired
|
||||||
|
private AuthUserService authUserService;
|
||||||
|
@Autowired
|
||||||
|
private AuthRoleService authRoleService;
|
||||||
|
@Autowired
|
||||||
|
private AuthPermissionService authPermissionService;
|
||||||
|
|
||||||
|
@RequestMapping("/auth/info")
|
||||||
|
public Map<String, Object> info() {
|
||||||
|
final Map<String, Object> map = new HashMap<>(4);
|
||||||
|
final String account = getUserAccount();
|
||||||
|
final AuthUser authUser = authUserService.find(
|
||||||
|
new Search(AuthUser.ACCOUNT, account));
|
||||||
|
Assert.state(authUser != null,
|
||||||
|
() -> "No user [" + account + "] found");
|
||||||
|
Assert.state(authUser.getActive(),
|
||||||
|
() -> "User [" + account + "] is not active");
|
||||||
|
|
||||||
|
map.put("account", account);
|
||||||
|
map.put("name", getUsername());
|
||||||
|
map.put("roles", authRoleService.listOfUser(account));
|
||||||
|
map.put("permissions", authPermissionService.listOfUser(account));
|
||||||
|
map.put("tenants", authUser.isAdmin() ?
|
||||||
|
tenantService.listOfAdmin() :
|
||||||
|
tenantService.listOfUser(account));
|
||||||
|
map.put("tenant", tenantService.current(account));
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/auth/switch-tenant")
|
||||||
|
public void switchTenant(@NotBlank @RequestParam("tenant") final String tenant) {
|
||||||
|
tenantService.switchTo(getUserAccount(), tenant);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,65 @@
|
|||||||
|
package com.pudonghot.yo.cms.controller;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.annotation.Taggable;
|
||||||
|
import com.pudonghot.yo.cms.auth.SessionAbility;
|
||||||
|
import com.pudonghot.yo.cms.form.create.CreateFormAuthPermission;
|
||||||
|
import com.wacai.tigon.form.FormList;
|
||||||
|
import com.wacai.tigon.model.ViewModel;
|
||||||
|
import com.wacai.tigon.web.controller.ArgQuery;
|
||||||
|
import com.wacai.tigon.web.annotation.ListApi;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import com.wacai.tigon.web.annotation.FilterCol;
|
||||||
|
import com.pudonghot.yo.cms.service.AuthRoleService;
|
||||||
|
import com.pudonghot.yo.model.domain.AuthPermission;
|
||||||
|
import com.wacai.tigon.web.controller.BaseCrudController;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import com.pudonghot.yo.cms.form.update.UpdateFormAuthPermission;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Dec 24, 2019 17:24:04
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@ListApi(searchCols = {
|
||||||
|
AuthPermission.PERMISSION,
|
||||||
|
AuthPermission.NOTE
|
||||||
|
},
|
||||||
|
filterCols = {
|
||||||
|
@FilterCol(param = AuthPermission.ACTIVE, type = boolean.class),
|
||||||
|
@FilterCol(param = AuthPermission.TAGS, type = Integer.class, searchAttr = true),
|
||||||
|
@FilterCol(param = AuthPermission.ROLES, type = Integer.class, searchAttr = true)
|
||||||
|
})
|
||||||
|
@Taggable
|
||||||
|
@RequestMapping("/auth-permission")
|
||||||
|
public class AuthPermissionController
|
||||||
|
extends BaseCrudController<Integer,
|
||||||
|
AuthPermission,
|
||||||
|
FormList,
|
||||||
|
CreateFormAuthPermission,
|
||||||
|
UpdateFormAuthPermission>
|
||||||
|
implements SessionAbility {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AuthRoleService authRoleService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void before(final ArgQuery<?> arg) {
|
||||||
|
super.before(arg);
|
||||||
|
arg.getSearch().attr("withRoles", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void after(final ArgQuery<?> arg) {
|
||||||
|
super.after(arg);
|
||||||
|
|
||||||
|
final ViewModel<?> model = arg.getResult();
|
||||||
|
model.setAttr("rolesList", authRoleService.list(null));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,37 @@
|
|||||||
|
package com.pudonghot.yo.cms.controller;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.auth.SessionAbility;
|
||||||
|
import com.pudonghot.yo.cms.form.create.CreateFormAuthRole;
|
||||||
|
import com.wacai.tigon.form.FormList;
|
||||||
|
import com.wacai.tigon.web.annotation.ListApi;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import com.pudonghot.yo.model.domain.AuthRole;
|
||||||
|
import com.wacai.tigon.web.annotation.FilterCol;
|
||||||
|
import com.pudonghot.yo.cms.annotation.Taggable;
|
||||||
|
import com.wacai.tigon.web.controller.BaseCrudController;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import com.pudonghot.yo.cms.form.update.UpdateFormAuthRole;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Dec 24, 2019 17:13:49
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@ListApi(searchCols = {
|
||||||
|
AuthRole.ROLE,
|
||||||
|
AuthRole.NOTE
|
||||||
|
},
|
||||||
|
filterCols = {
|
||||||
|
@FilterCol(param = AuthRole.ACTIVE, type = boolean.class),
|
||||||
|
@FilterCol(param = AuthRole.TAGS, type = Integer.class, searchAttr = true)
|
||||||
|
})
|
||||||
|
@Taggable
|
||||||
|
@RequestMapping("/auth-role")
|
||||||
|
public class AuthRoleController
|
||||||
|
extends BaseCrudController<Integer,
|
||||||
|
AuthRole,
|
||||||
|
FormList,
|
||||||
|
CreateFormAuthRole,
|
||||||
|
UpdateFormAuthRole>
|
||||||
|
implements SessionAbility {
|
||||||
|
}
|
@ -0,0 +1,73 @@
|
|||||||
|
package com.pudonghot.yo.cms.controller;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.auth.SessionAbility;
|
||||||
|
import com.pudonghot.yo.cms.form.create.CreateFormAuthUser;
|
||||||
|
import com.wacai.tigon.form.FormList;
|
||||||
|
import com.wacai.tigon.model.ViewModel;
|
||||||
|
import com.wacai.tigon.web.controller.ArgQuery;
|
||||||
|
import com.wacai.tigon.web.annotation.ListApi;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import com.pudonghot.yo.model.domain.AuthUser;
|
||||||
|
import com.wacai.tigon.web.annotation.FilterCol;
|
||||||
|
import com.pudonghot.yo.cms.annotation.Taggable;
|
||||||
|
import com.pudonghot.yo.cms.service.TenantService;
|
||||||
|
import com.pudonghot.yo.cms.service.AuthRoleService;
|
||||||
|
import com.wacai.tigon.web.controller.BaseCrudController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import com.pudonghot.yo.cms.form.update.UpdateFormAuthUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Dec 24, 2019 17:13:49
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@ListApi(searchCols = {
|
||||||
|
AuthUser.NAME,
|
||||||
|
AuthUser.ACCOUNT,
|
||||||
|
AuthUser.NOTE
|
||||||
|
},
|
||||||
|
filterCols = {
|
||||||
|
@FilterCol(param = AuthUser.ACTIVE, type = boolean.class),
|
||||||
|
@FilterCol(param = AuthUser.ADMIN, type = boolean.class),
|
||||||
|
@FilterCol(param = AuthUser.TAGS, type = Integer.class, searchAttr = true),
|
||||||
|
@FilterCol(param = AuthUser.ROLES, type = Integer.class, searchAttr = true),
|
||||||
|
@FilterCol(param = AuthUser.TENANTS, type = Integer.class, searchAttr = true)
|
||||||
|
})
|
||||||
|
@Taggable
|
||||||
|
@RequestMapping("/auth-user")
|
||||||
|
public class AuthUserController
|
||||||
|
extends BaseCrudController<Integer,
|
||||||
|
AuthUser,
|
||||||
|
FormList,
|
||||||
|
CreateFormAuthUser,
|
||||||
|
UpdateFormAuthUser>
|
||||||
|
implements SessionAbility {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AuthRoleService authRoleService;
|
||||||
|
@Autowired
|
||||||
|
private TenantService tenantService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void before(final ArgQuery<?> arg) {
|
||||||
|
super.before(arg);
|
||||||
|
arg.getSearch().attr("withRoles", true)
|
||||||
|
.attr("withTenants", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void after(final ArgQuery<?> arg) {
|
||||||
|
super.after(arg);
|
||||||
|
|
||||||
|
final ViewModel<?> model = arg.getResult();
|
||||||
|
model.setAttr("rolesList", authRoleService.list(null));
|
||||||
|
model.setAttr("tenantsList", tenantService.list(null));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,69 @@
|
|||||||
|
package com.pudonghot.yo.cms.controller;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.auth.SessionAbility;
|
||||||
|
import com.pudonghot.yo.cms.form.CallDetailRecordListForm;
|
||||||
|
import com.pudonghot.yo.mapper.CallRecordingMapper;
|
||||||
|
import com.pudonghot.yo.model.domain.CallDetailRecord;
|
||||||
|
import com.pudonghot.yo.model.domain.CallRecording;
|
||||||
|
import com.wacai.tigon.model.ViewModel;
|
||||||
|
import com.wacai.tigon.mybatis.Search;
|
||||||
|
import com.wacai.tigon.web.controller.ArgQuery;
|
||||||
|
import com.wacai.tigon.web.controller.BaseQueryController;
|
||||||
|
import com.wacai.tigon.web.annotation.FilterCol;
|
||||||
|
import com.wacai.tigon.web.annotation.ListApi;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author bingpo
|
||||||
|
* @date 2020/3/30 下午3:27
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@ListApi(searchCols = {
|
||||||
|
CallDetailRecord.CONN_ID
|
||||||
|
},
|
||||||
|
filterCols = {
|
||||||
|
@FilterCol(param = CallDetailRecord.CONN_ID, type = String.class)
|
||||||
|
})
|
||||||
|
@RequestMapping("/call-detail-record")
|
||||||
|
public class CallDetailRecordController
|
||||||
|
extends BaseQueryController<Integer, CallDetailRecord, CallDetailRecordListForm>
|
||||||
|
implements SessionAbility {
|
||||||
|
@Autowired
|
||||||
|
private CallRecordingMapper callRecordingMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void before(ArgQuery<?> arg) {
|
||||||
|
if (arg.getType() == ArgQuery.Type.LIST) {
|
||||||
|
final CallDetailRecordListForm form = (CallDetailRecordListForm) arg.getArg();
|
||||||
|
final Search search = arg.getSearch();
|
||||||
|
search.gt(CallDetailRecord.START_STAMP, form.getStartDate());
|
||||||
|
search.lt(CallDetailRecord.START_STAMP, form.getEndDate());
|
||||||
|
final String connId = form.getConnId();
|
||||||
|
if (StringUtils.isNotBlank(connId)) {
|
||||||
|
search.eq(CallDetailRecord.CONN_ID, connId);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void after(ArgQuery<?> arg) {
|
||||||
|
super.after(arg);
|
||||||
|
if (arg.getType() == ArgQuery.Type.LIST) {
|
||||||
|
final ViewModel<List<ViewModel<CallDetailRecord>>> vmList =
|
||||||
|
(ViewModel<List<ViewModel<CallDetailRecord>>>) arg.getResult();
|
||||||
|
vmList.getData().forEach(vm -> {
|
||||||
|
final CallDetailRecord record = vm.getData();
|
||||||
|
if (record.getAnswerStamp() != null) {
|
||||||
|
vm.setAttr("recording", callRecordingMapper.find(
|
||||||
|
new Search(CallRecording.CONN_ID, vm.getData().getConnId())));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,91 @@
|
|||||||
|
package com.pudonghot.yo.cms.controller;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.auth.SessionAbility;
|
||||||
|
import com.pudonghot.yo.cms.form.create.CreateFormCallingList;
|
||||||
|
import com.pudonghot.yo.cms.annotation.TenantResource;
|
||||||
|
import com.pudonghot.yo.cms.form.update.UpdateFormCallingList;
|
||||||
|
import com.pudonghot.yo.mapper.CampaignMapper;
|
||||||
|
import com.pudonghot.yo.model.domain.CallingList;
|
||||||
|
import com.pudonghot.yo.model.domain.Campaign;
|
||||||
|
import com.wacai.tigon.form.FormList;
|
||||||
|
import com.wacai.tigon.model.ViewModel;
|
||||||
|
import com.wacai.tigon.mybatis.Search;
|
||||||
|
import com.wacai.tigon.web.controller.ArgQuery;
|
||||||
|
import com.wacai.tigon.web.controller.BaseCrudController;
|
||||||
|
import com.wacai.tigon.web.annotation.FilterCol;
|
||||||
|
import com.wacai.tigon.web.annotation.ListApi;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author bingpo
|
||||||
|
* @date 2020/3/16 下午4:00
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@ListApi(searchCols = {
|
||||||
|
CallingList.PHONE,
|
||||||
|
CallingList.RECORD_KEY,
|
||||||
|
CallingList.TASK_KEY
|
||||||
|
},
|
||||||
|
filterCols = {
|
||||||
|
@FilterCol(param = CallingList.ACTIVE, type = boolean.class),
|
||||||
|
@FilterCol(param = CallingList.CAMPAIGN_ID, type = Integer.class),
|
||||||
|
@FilterCol(param = CallingList.STATUS, type = String.class),
|
||||||
|
})
|
||||||
|
@TenantResource
|
||||||
|
@RequestMapping("/calling-list")
|
||||||
|
public class CallingListController
|
||||||
|
extends BaseCrudController<Integer,
|
||||||
|
CallingList,
|
||||||
|
FormList,
|
||||||
|
CreateFormCallingList,
|
||||||
|
UpdateFormCallingList> implements SessionAbility {
|
||||||
|
@Autowired
|
||||||
|
private CampaignMapper campaignMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void before(final ArgQuery<?> arg) {
|
||||||
|
super.before(arg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void after(final ArgQuery<?> arg) {
|
||||||
|
super.after(arg);
|
||||||
|
if (arg.getType() == ArgQuery.Type.LIST) {
|
||||||
|
final ViewModel<List<ViewModel<CallingList>>> vmList =
|
||||||
|
(ViewModel<List<ViewModel<CallingList>>>) arg.getResult();
|
||||||
|
vmList.getData().forEach(vm ->
|
||||||
|
vm.setAttr("campaign", campaignMapper.find(new Search(vm.getData().getCampaignId())))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
final ViewModel<?> vm = arg.getResult();
|
||||||
|
vm.setAttr("campaignList", campaignMapper.list(new Search(Campaign.ACTIVE, true)));
|
||||||
|
vm.setAttr("callingListStatus", status());
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/status")
|
||||||
|
public List<Map<String, Object>> status() {
|
||||||
|
CallingList.Status[] statusArr = CallingList.Status.values();
|
||||||
|
List<Map<String, Object>> statusList = new ArrayList<>(statusArr.length);
|
||||||
|
for (CallingList.Status status : CallingList.Status.values()) {
|
||||||
|
statusList.add(
|
||||||
|
new HashMap<String, Object>(4) {{
|
||||||
|
put("label", status.name());
|
||||||
|
put("value", status.name());
|
||||||
|
}});
|
||||||
|
}
|
||||||
|
return statusList;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,116 @@
|
|||||||
|
package com.pudonghot.yo.cms.controller;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.auth.SessionAbility;
|
||||||
|
import com.pudonghot.yo.cms.form.create.CreateFormCampaign;
|
||||||
|
import com.pudonghot.yo.cms.service.CampaignService;
|
||||||
|
import com.pudonghot.yo.mapper.RobotCallConfigMapper;
|
||||||
|
import com.pudonghot.yo.model.domain.Campaign;
|
||||||
|
import com.pudonghot.yo.model.domain.RobotCallConfig;
|
||||||
|
import com.pudonghot.yo.model.domain.TrunkStrategy;
|
||||||
|
import com.wacai.tigon.form.FormList;
|
||||||
|
import com.wacai.tigon.model.ViewModel;
|
||||||
|
import com.wacai.tigon.mybatis.Search;
|
||||||
|
import com.wacai.tigon.web.controller.ArgQuery;
|
||||||
|
import com.wacai.tigon.web.annotation.ListApi;
|
||||||
|
import org.apache.shiro.util.Assert;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import com.wacai.tigon.web.annotation.FilterCol;
|
||||||
|
import com.pudonghot.yo.cms.annotation.Taggable;
|
||||||
|
import com.wacai.tigon.web.controller.BaseCrudController;
|
||||||
|
import com.pudonghot.yo.cms.annotation.TenantResource;
|
||||||
|
import com.pudonghot.yo.cms.service.TrunkStrategyService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import com.pudonghot.yo.cms.form.update.UpdateFormCampaign;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 02, 2019 13:46:16
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@ListApi(searchCols = {
|
||||||
|
Campaign.NAME,
|
||||||
|
Campaign.NOTE
|
||||||
|
},
|
||||||
|
filterCols = {
|
||||||
|
@FilterCol(param = Campaign.ACTIVE, type = boolean.class),
|
||||||
|
@FilterCol(param = Campaign.STATUS, type = Campaign.Status.class),
|
||||||
|
@FilterCol(param = Campaign.TYPE, type = Campaign.Type.class),
|
||||||
|
@FilterCol(param = Campaign.TRUNK_STRATEGIES, type = Integer.class, searchAttr = true),
|
||||||
|
@FilterCol(param = Campaign.TAGS, type = Integer.class, searchAttr = true)
|
||||||
|
})
|
||||||
|
@Taggable
|
||||||
|
@TenantResource
|
||||||
|
@RequestMapping("/campaign")
|
||||||
|
public class CampaignController
|
||||||
|
extends BaseCrudController<Integer,
|
||||||
|
Campaign,
|
||||||
|
FormList,
|
||||||
|
CreateFormCampaign,
|
||||||
|
UpdateFormCampaign> implements SessionAbility {
|
||||||
|
@Autowired
|
||||||
|
private TrunkStrategyService trunkStrategyService;
|
||||||
|
@Autowired
|
||||||
|
private RobotCallConfigMapper robotCallConfigMapper;
|
||||||
|
|
||||||
|
@RequestMapping("/start")
|
||||||
|
public void start(@RequestParam("id") Integer id) {
|
||||||
|
activity(id, Campaign.Status.RUNNING);
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/stop")
|
||||||
|
public void stop(@RequestParam("id") Integer id) {
|
||||||
|
activity(id, Campaign.Status.STOPPED);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void activity(final Integer id, final Campaign.Status status) {
|
||||||
|
final CampaignService campaignService = ((CampaignService) crudService);
|
||||||
|
final Campaign campaign = campaignService.find(new Search(id).eq(Campaign.ACTIVE, true));
|
||||||
|
Assert.state(campaign != null, "无效的外呼活动");
|
||||||
|
campaign.setStatus(status);
|
||||||
|
campaignService.update(campaign);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void before(final ArgQuery<?> arg) {
|
||||||
|
super.before(arg);
|
||||||
|
arg.getSearch().attr("withTrunkStrategies", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void after(final ArgQuery<?> arg) {
|
||||||
|
super.after(arg);
|
||||||
|
arg.getResult().attr("trunkStrategiesList",
|
||||||
|
trunkStrategyService.list(
|
||||||
|
new Search(TrunkStrategy.TENANT_ID, getTenantId())));
|
||||||
|
// arg.getResult().attr("stateMachineList", stateMachineList());
|
||||||
|
if (arg.getType() == ArgQuery.Type.LIST) {
|
||||||
|
final ViewModel<List<ViewModel<Campaign>>> vmList =
|
||||||
|
(ViewModel<List<ViewModel<Campaign>>>) arg.getResult();
|
||||||
|
vmList.getData().forEach(vm ->
|
||||||
|
vm.setAttr("running", vm.getData().getStatus() == Campaign.Status.RUNNING)
|
||||||
|
);
|
||||||
|
} else if (arg.getType() == ArgQuery.Type.FIND) {
|
||||||
|
final ViewModel<Campaign> vm = (ViewModel<Campaign>) arg.getResult();
|
||||||
|
final RobotCallConfig robotCallConfig = robotCallConfigMapper.find(
|
||||||
|
new Search(RobotCallConfig.CAMPAIGN_ID, vm.getData().getId()));
|
||||||
|
if (robotCallConfig != null) {
|
||||||
|
vm.setAttr("robotResultTopic", robotCallConfig.getResultTopic());
|
||||||
|
vm.setAttr("robotStateMachineId", robotCallConfig.getStateMachineId());
|
||||||
|
vm.setAttr("robotFetchData", robotCallConfig.getFetchData());
|
||||||
|
vm.setAttr("robotFetchLocal", !robotCallConfig.getFetchLocal());
|
||||||
|
vm.setAttr("robotFetchUrl", robotCallConfig.getFetchUrl());
|
||||||
|
vm.setAttr("robotFetchHeader", robotCallConfig.getFetchHeader());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package com.pudonghot.yo.cms.controller;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.create.CreateFormGateway;
|
||||||
|
import com.wacai.tigon.form.FormList;
|
||||||
|
import com.pudonghot.yo.model.domain.Gateway;
|
||||||
|
import com.wacai.tigon.web.annotation.ListApi;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import com.wacai.tigon.web.annotation.FilterCol;
|
||||||
|
import com.wacai.tigon.web.controller.BaseCrudController;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import com.pudonghot.yo.cms.form.update.UpdateFormGateway;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 01, 2019 22:53:11
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@ListApi(searchCols = {
|
||||||
|
Gateway.NAME,
|
||||||
|
Gateway.NOTE
|
||||||
|
},
|
||||||
|
filterCols = {
|
||||||
|
@FilterCol(param = Gateway.ACTIVE, type = boolean.class)
|
||||||
|
})
|
||||||
|
@RequestMapping("/gateway")
|
||||||
|
public class GatewayController
|
||||||
|
extends BaseCrudController<Integer,
|
||||||
|
Gateway,
|
||||||
|
FormList,
|
||||||
|
CreateFormGateway,
|
||||||
|
UpdateFormGateway> {
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
package com.pudonghot.yo.cms.controller;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.create.CreateFormQueue;
|
||||||
|
import com.wacai.tigon.form.FormList;
|
||||||
|
import com.pudonghot.yo.model.domain.Queue;
|
||||||
|
import com.wacai.tigon.web.annotation.ListApi;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import com.wacai.tigon.web.annotation.FilterCol;
|
||||||
|
import com.wacai.tigon.web.controller.BaseCrudController;
|
||||||
|
import com.pudonghot.yo.cms.annotation.TenantResource;
|
||||||
|
import com.pudonghot.yo.cms.form.update.UpdateFormQueue;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 01, 2019 22:53:11
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@ListApi(searchCols = {
|
||||||
|
Queue.NAME,
|
||||||
|
Queue.NOTE
|
||||||
|
},
|
||||||
|
filterCols = {
|
||||||
|
@FilterCol(param = Queue.ACTIVE, type = boolean.class)
|
||||||
|
})
|
||||||
|
@TenantResource
|
||||||
|
@RequestMapping("/queue")
|
||||||
|
public class QueueController
|
||||||
|
extends BaseCrudController<Integer,
|
||||||
|
Queue,
|
||||||
|
FormList,
|
||||||
|
CreateFormQueue,
|
||||||
|
UpdateFormQueue> {
|
||||||
|
}
|
@ -0,0 +1,114 @@
|
|||||||
|
package com.pudonghot.yo.cms.controller;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.auth.SessionAbility;
|
||||||
|
import com.pudonghot.yo.cms.form.create.CreateFormRobotAgent;
|
||||||
|
import com.pudonghot.yo.cms.annotation.Taggable;
|
||||||
|
import com.pudonghot.yo.cms.annotation.TenantResource;
|
||||||
|
import com.pudonghot.yo.cms.form.update.UpdateFormRobotAgent;
|
||||||
|
import com.pudonghot.yo.cms.service.AgentService;
|
||||||
|
import com.pudonghot.yo.cms.service.RobotAgentService;
|
||||||
|
import com.pudonghot.yo.model.domain.Agent;
|
||||||
|
import com.pudonghot.yo.model.domain.RobotAgent;
|
||||||
|
import com.pudonghot.yo.model.ValueTextModel;
|
||||||
|
import com.wacai.tigon.form.FormList;
|
||||||
|
import com.wacai.tigon.model.ViewModel;
|
||||||
|
import com.wacai.tigon.mybatis.Search;
|
||||||
|
import com.wacai.tigon.web.controller.ArgQuery;
|
||||||
|
import com.wacai.tigon.web.controller.BaseCrudController;
|
||||||
|
import com.wacai.tigon.web.annotation.FilterCol;
|
||||||
|
import com.wacai.tigon.web.annotation.ListApi;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author qiushui <br>
|
||||||
|
* qiushui@wacai.com <br>
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@ListApi(searchCols = {
|
||||||
|
RobotAgent.ACCOUNT,
|
||||||
|
RobotAgent.AGENT,
|
||||||
|
RobotAgent.BIND_ADDR
|
||||||
|
},
|
||||||
|
filterCols = {
|
||||||
|
@FilterCol(param = RobotAgent.ACTIVE, type = boolean.class),
|
||||||
|
@FilterCol(param = RobotAgent.STATUS, type = RobotAgent.Status.class),
|
||||||
|
@FilterCol(param = RobotAgent.BIND_ADDR, type = String.class)
|
||||||
|
})
|
||||||
|
@Taggable
|
||||||
|
@TenantResource
|
||||||
|
@RequestMapping("/robot-agent")
|
||||||
|
public class RobotAgentController
|
||||||
|
extends BaseCrudController<Integer,
|
||||||
|
RobotAgent,
|
||||||
|
FormList,
|
||||||
|
CreateFormRobotAgent,
|
||||||
|
UpdateFormRobotAgent> implements SessionAbility {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AgentService agentService;
|
||||||
|
|
||||||
|
|
||||||
|
@RequestMapping("/batch-create")
|
||||||
|
public void batchCreate(@Valid CreateFormRobotAgent form) {
|
||||||
|
((RobotAgentService) queryService).batchCreate(form);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void after(final ArgQuery<?> arg) {
|
||||||
|
super.after(arg);
|
||||||
|
final ViewModel<?> model = arg.getResult();
|
||||||
|
model.setAttr("statusList", statusList());
|
||||||
|
model.setAttr("bindAddrList", bindAddrList());
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ValueTextModel> bindAddrList() {
|
||||||
|
List<ValueTextModel> list = new ArrayList<>();
|
||||||
|
List<RobotAgent> robotAgentList = queryService.list(new Search());
|
||||||
|
Set<String> bindAddressSet = robotAgentList.stream().map(RobotAgent::getBindAddr).filter(item -> !StringUtils.isEmpty(item)).collect(Collectors.toSet());
|
||||||
|
for (String bindAddress : bindAddressSet) {
|
||||||
|
list.add(new ValueTextModel(bindAddress, bindAddress));
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ValueTextModel> statusList() {
|
||||||
|
List<ValueTextModel> list = new ArrayList<>();
|
||||||
|
for (RobotAgent.Status status : RobotAgent.Status.values()) {
|
||||||
|
list.add(new ValueTextModel(status.name(), status.name()));
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/list-agent")
|
||||||
|
public List<ValueTextModel> listAgent() {
|
||||||
|
List<ValueTextModel> list = new ArrayList<>();
|
||||||
|
Integer tenantId = getTenantId();
|
||||||
|
List<Agent> agentList = agentService.list(new Search().eq(Agent.ACTIVE, true)
|
||||||
|
.eq(Agent.TENANT_ID, tenantId).eq(Agent.TYPE, Agent.Type.ROBOT));
|
||||||
|
|
||||||
|
Map<Integer, RobotAgent> robotAgentMap = queryService.list(new Search()).
|
||||||
|
stream().collect(Collectors.toMap(RobotAgent::getAgentId, Function.identity()
|
||||||
|
));
|
||||||
|
agentList = agentList.stream().
|
||||||
|
filter(item -> !robotAgentMap.keySet().contains(item.getId())).
|
||||||
|
collect(Collectors.toList());
|
||||||
|
|
||||||
|
for (Agent agent : agentList) {
|
||||||
|
list.add(new ValueTextModel(agent.getId(), agent.getAccount()+":"+agent.getAgent()));
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
package com.pudonghot.yo.cms.controller;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.create.CreateFormSequence;
|
||||||
|
import com.pudonghot.yo.cms.annotation.TenantResource;
|
||||||
|
import com.wacai.tigon.form.FormList;
|
||||||
|
import com.wacai.tigon.web.annotation.ListApi;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import com.pudonghot.yo.model.domain.Sequence;
|
||||||
|
import com.wacai.tigon.web.annotation.FilterCol;
|
||||||
|
import com.wacai.tigon.web.controller.BaseCrudController;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import com.pudonghot.yo.cms.form.update.UpdateFormSequence;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 02, 2019 12:46:49
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@ListApi(searchCols = {
|
||||||
|
Sequence.NAME,
|
||||||
|
Sequence.NOTE
|
||||||
|
},
|
||||||
|
filterCols = {
|
||||||
|
@FilterCol(param = Sequence.ACTIVE, type = boolean.class)
|
||||||
|
})
|
||||||
|
@TenantResource
|
||||||
|
@RequestMapping("/sequence")
|
||||||
|
public class SequenceController
|
||||||
|
extends BaseCrudController<Integer,
|
||||||
|
Sequence,
|
||||||
|
FormList,
|
||||||
|
CreateFormSequence,
|
||||||
|
UpdateFormSequence> {
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package com.pudonghot.yo.cms.controller;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.core.io.Resource;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.core.io.ClassPathResource;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Oct 26, 2019 15:57:14
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Controller
|
||||||
|
public class SiteController {
|
||||||
|
|
||||||
|
@RequestMapping("/")
|
||||||
|
public ResponseEntity<Resource> index() {
|
||||||
|
return ResponseEntity.ok(new ClassPathResource("/yo-cms/index.html"));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,51 @@
|
|||||||
|
package com.pudonghot.yo.cms.controller;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.auth.SessionAbility;
|
||||||
|
import com.pudonghot.yo.cms.form.create.CreateFormTag;
|
||||||
|
import com.wacai.tigon.form.FormList;
|
||||||
|
import com.pudonghot.yo.model.domain.Tag;
|
||||||
|
import com.wacai.tigon.web.controller.ArgQuery;
|
||||||
|
import com.wacai.tigon.web.annotation.ListApi;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import com.wacai.tigon.web.annotation.FilterCol;
|
||||||
|
import com.wacai.tigon.web.controller.BaseCrudController;
|
||||||
|
import com.pudonghot.yo.cms.form.update.UpdateFormTag;
|
||||||
|
import com.pudonghot.yo.cms.annotation.TenantResource;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 14, 2019 12:05:22
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@ListApi(searchCols = {
|
||||||
|
Tag.TAG,
|
||||||
|
Tag.NOTE
|
||||||
|
},
|
||||||
|
filterCols = {
|
||||||
|
@FilterCol(param = Tag.SCOPE, type = Tag.Scope.class),
|
||||||
|
@FilterCol(param = Tag.ACTIVE, type = boolean.class)
|
||||||
|
})
|
||||||
|
@TenantResource
|
||||||
|
@RequestMapping("/tag")
|
||||||
|
public class TagController
|
||||||
|
extends BaseCrudController<Integer,
|
||||||
|
Tag,
|
||||||
|
FormList,
|
||||||
|
CreateFormTag,
|
||||||
|
UpdateFormTag>
|
||||||
|
implements SessionAbility {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void before(final ArgQuery<?> arg) {
|
||||||
|
super.before(arg);
|
||||||
|
arg.getSearch().in(Tag.OWNER,
|
||||||
|
Arrays.asList(Tag.OWNER_COMMON,
|
||||||
|
getUserAccount()));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package com.pudonghot.yo.cms.controller;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.create.CreateFormTelecomVendor;
|
||||||
|
import com.wacai.tigon.form.FormList;
|
||||||
|
import com.wacai.tigon.web.annotation.ListApi;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import com.wacai.tigon.web.annotation.FilterCol;
|
||||||
|
import com.pudonghot.yo.model.domain.TelecomVendor;
|
||||||
|
import com.wacai.tigon.web.controller.BaseCrudController;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import com.pudonghot.yo.cms.form.update.UpdateFormTelecomVendor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 01, 2019 22:53:11
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@ListApi(searchCols = {
|
||||||
|
TelecomVendor.NAME,
|
||||||
|
TelecomVendor.NOTE
|
||||||
|
},
|
||||||
|
filterCols = {
|
||||||
|
@FilterCol(param = TelecomVendor.ACTIVE, type = boolean.class)
|
||||||
|
})
|
||||||
|
@RequestMapping("/telecom-vendor")
|
||||||
|
public class TelecomVendorController
|
||||||
|
extends BaseCrudController<Integer,
|
||||||
|
TelecomVendor,
|
||||||
|
FormList,
|
||||||
|
CreateFormTelecomVendor,
|
||||||
|
UpdateFormTelecomVendor> {
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package com.pudonghot.yo.cms.controller;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.create.CreateFormTenant;
|
||||||
|
import com.wacai.tigon.form.FormList;
|
||||||
|
import com.pudonghot.yo.model.domain.Tenant;
|
||||||
|
import com.wacai.tigon.web.annotation.ListApi;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import com.wacai.tigon.web.annotation.FilterCol;
|
||||||
|
import com.wacai.tigon.web.controller.BaseCrudController;
|
||||||
|
import com.pudonghot.yo.cms.form.update.UpdateFormTenant;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Oct 26, 2019 16:02:19
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@ListApi(searchCols = {
|
||||||
|
Tenant.NAME,
|
||||||
|
Tenant.CODE,
|
||||||
|
Tenant.NOTE
|
||||||
|
},
|
||||||
|
filterCols = {
|
||||||
|
@FilterCol(param = Tenant.ACTIVE, type = boolean.class)
|
||||||
|
})
|
||||||
|
@RequestMapping("/tenant")
|
||||||
|
public class TenantController extends BaseCrudController<Integer, Tenant, FormList, CreateFormTenant, UpdateFormTenant> {
|
||||||
|
}
|
@ -0,0 +1,82 @@
|
|||||||
|
package com.pudonghot.yo.cms.controller;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.auth.SessionAbility;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import com.wacai.tigon.mybatis.Search;
|
||||||
|
import com.wacai.tigon.model.ViewModel;
|
||||||
|
import com.wacai.tigon.web.controller.ArgQuery;
|
||||||
|
import com.pudonghot.yo.model.domain.Agent;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import com.pudonghot.yo.model.domain.ObjectTag;
|
||||||
|
import com.pudonghot.yo.cms.service.TagService;
|
||||||
|
import com.pudonghot.yo.cms.annotation.Taggable;
|
||||||
|
import org.springframework.core.annotation.AnnotationUtils;
|
||||||
|
import com.pudonghot.yo.cms.annotation.TenantResource;
|
||||||
|
import com.wacai.tigon.web.controller.BaseQueryControllerHook;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 04, 2019 23:05:13
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class TenantQueryHook implements BaseQueryControllerHook, SessionAbility {
|
||||||
|
@Autowired
|
||||||
|
private TagService tagService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void init(final ArgQuery<?> arg) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void before(final ArgQuery<?> arg) {
|
||||||
|
final TenantResource tr = AnnotationUtils.findAnnotation(
|
||||||
|
arg.getController(), TenantResource.class);
|
||||||
|
if (tr != null) {
|
||||||
|
final Integer tenantId = getTenantId();
|
||||||
|
if (tr.searchAttr()) {
|
||||||
|
log.debug("Query before: @TenantResource found, add search attr [{}].", tenantId);
|
||||||
|
arg.getSearch().setAttr(
|
||||||
|
Agent.TENANT_ID, tenantId);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
log.debug("Query before: @TenantResource found, add search criterion [{}].", tenantId);
|
||||||
|
arg.getSearch().eq(Agent.TENANT_ID, tenantId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Taggable
|
||||||
|
final Taggable taggable = AnnotationUtils.findAnnotation(
|
||||||
|
arg.getController(), Taggable.class);
|
||||||
|
if (taggable != null) {
|
||||||
|
log.debug("Query before: @Taggable found, add search attr 'withTags'");
|
||||||
|
arg.getSearch().attr("withTags", true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void after(final ArgQuery<?> arg) {
|
||||||
|
final Taggable taggable = AnnotationUtils.findAnnotation(
|
||||||
|
arg.getController(), Taggable.class);
|
||||||
|
if (taggable != null) {
|
||||||
|
final Integer tenantId = getTenantId();
|
||||||
|
log.debug("Query after: @Taggable found, add tenant [{}] tags.", tenantId);
|
||||||
|
final ViewModel<?> result = arg.getResult();
|
||||||
|
if (result != null) {
|
||||||
|
result.setAttr("tagsList", tagService.list(
|
||||||
|
new Search(ObjectTag.TENANT_ID, tenantId)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
package com.pudonghot.yo.cms.controller;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.auth.SessionAbility;
|
||||||
|
import com.pudonghot.yo.cms.form.create.CreateFormTrunkAttr;
|
||||||
|
import com.wacai.tigon.form.FormList;
|
||||||
|
import com.wacai.tigon.web.annotation.ListApi;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import com.wacai.tigon.web.annotation.FilterCol;
|
||||||
|
import com.pudonghot.yo.model.domain.TrunkAttr;
|
||||||
|
import com.wacai.tigon.web.controller.BaseCrudController;
|
||||||
|
import com.pudonghot.yo.cms.annotation.TenantResource;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import com.pudonghot.yo.cms.form.update.UpdateFormTrunkAttr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Jan 17, 2020 15:30:57
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@ListApi(searchCols = {
|
||||||
|
TrunkAttr.ATTR,
|
||||||
|
TrunkAttr.NOTE
|
||||||
|
},
|
||||||
|
filterCols = {
|
||||||
|
@FilterCol(param = TrunkAttr.ACTIVE, type = boolean.class)
|
||||||
|
})
|
||||||
|
@TenantResource
|
||||||
|
@RequestMapping("/trunk-attr")
|
||||||
|
public class TrunkAttrController
|
||||||
|
extends BaseCrudController<Integer,
|
||||||
|
TrunkAttr,
|
||||||
|
FormList,
|
||||||
|
CreateFormTrunkAttr,
|
||||||
|
UpdateFormTrunkAttr>
|
||||||
|
implements SessionAbility {
|
||||||
|
}
|
@ -0,0 +1,119 @@
|
|||||||
|
package com.pudonghot.yo.cms.controller;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.auth.SessionAbility;
|
||||||
|
import com.pudonghot.yo.cms.form.create.CreateFormTrunk;
|
||||||
|
import com.pudonghot.yo.cms.service.*;
|
||||||
|
import com.wacai.tigon.form.FormList;
|
||||||
|
import com.wacai.tigon.model.ViewModel;
|
||||||
|
import com.wacai.tigon.mybatis.Search;
|
||||||
|
import com.pudonghot.yo.model.domain.Agent;
|
||||||
|
import com.pudonghot.yo.model.domain.Queue;
|
||||||
|
import com.pudonghot.yo.model.domain.Trunk;
|
||||||
|
import com.wacai.tigon.web.controller.ArgQuery;
|
||||||
|
import com.wacai.tigon.web.annotation.ListApi;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import com.wacai.tigon.web.annotation.FilterCol;
|
||||||
|
import com.pudonghot.yo.cms.annotation.Taggable;
|
||||||
|
import com.pudonghot.yo.model.domain.TrunkStrategy;
|
||||||
|
import com.wacai.tigon.web.controller.BaseCrudController;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import com.pudonghot.yo.cms.annotation.TenantResource;
|
||||||
|
import com.pudonghot.yo.cms.form.update.UpdateFormTrunk;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 02, 2019 12:46:49
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@ListApi(searchCols = {
|
||||||
|
Trunk.PREFIX,
|
||||||
|
Trunk.CALLER_NUMBER,
|
||||||
|
Trunk.CPN,
|
||||||
|
Trunk.NOTE
|
||||||
|
},
|
||||||
|
filterCols = {
|
||||||
|
@FilterCol(param = Trunk.ACTIVE, type = boolean.class),
|
||||||
|
@FilterCol(param = Trunk.AREA_CODE, type = String.class),
|
||||||
|
@FilterCol(param = Trunk.OC_ADD_ZERO, type = boolean.class),
|
||||||
|
@FilterCol(param = Trunk.GATEWAY_ID, type = Integer.class),
|
||||||
|
@FilterCol(param = Trunk.TELECOM_VENDOR_ID, type = Integer.class),
|
||||||
|
@FilterCol(param = Trunk.INBOUND_TARGET_TYPE, type = Trunk.InboundTargetType.class),
|
||||||
|
@FilterCol(param = Trunk.TAGS, type = Integer.class, searchAttr = true),
|
||||||
|
@FilterCol(param = Trunk.STRATEGIES, type = Integer.class, searchAttr = true),
|
||||||
|
@FilterCol(param = Trunk.ATTRS, type = Integer.class, searchAttr = true)
|
||||||
|
})
|
||||||
|
@Taggable
|
||||||
|
@TenantResource
|
||||||
|
@RequestMapping("/trunk")
|
||||||
|
public class TrunkController
|
||||||
|
extends BaseCrudController<Integer,
|
||||||
|
Trunk,
|
||||||
|
FormList,
|
||||||
|
CreateFormTrunk,
|
||||||
|
UpdateFormTrunk>
|
||||||
|
implements SessionAbility {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AreaCodeService areaCodeService;
|
||||||
|
@Autowired
|
||||||
|
private TelecomVendorService telecomVendorService;
|
||||||
|
@Autowired
|
||||||
|
private GatewayService gatewayService;
|
||||||
|
@Autowired
|
||||||
|
private TrunkStrategyService trunkStrategyService;
|
||||||
|
@Autowired
|
||||||
|
private TrunkAttrService trunkAttrService;
|
||||||
|
@Autowired
|
||||||
|
private AgentService agentService;
|
||||||
|
@Autowired
|
||||||
|
private QueueService queueService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* inbound target types
|
||||||
|
*
|
||||||
|
* @return inbound target types
|
||||||
|
*/
|
||||||
|
@GetMapping("/inbound-target-types")
|
||||||
|
public Trunk.InboundTargetType[] inboundTargetTypes() {
|
||||||
|
return Trunk.InboundTargetType.values();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void before(final ArgQuery<?> arg) {
|
||||||
|
super.before(arg);
|
||||||
|
arg.getSearch().attr("withStrategies", true);
|
||||||
|
arg.getSearch().attr("withAttrs", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void after(final ArgQuery<?> arg) {
|
||||||
|
super.after(arg);
|
||||||
|
|
||||||
|
final ViewModel<?> model = arg.getResult();
|
||||||
|
model.setAttr("gatewaysList", gatewayService.list(null));
|
||||||
|
model.setAttr("telecomVendorsList", telecomVendorService.list(null));
|
||||||
|
final Integer tenantId = getTenantId();
|
||||||
|
model.setAttr("trunkStrategiesList", trunkStrategyService.list(
|
||||||
|
new Search(TrunkStrategy.TENANT_ID, tenantId)));
|
||||||
|
model.setAttr("trunkAttrsList", trunkAttrService.list(
|
||||||
|
new Search(TrunkStrategy.TENANT_ID, tenantId)));
|
||||||
|
model.setAttr("inboundTargetTypesList",
|
||||||
|
Trunk.InboundTargetType.values());
|
||||||
|
model.attr("agentsList", agentService.list(
|
||||||
|
new Search(Agent.TENANT_ID, tenantId)));
|
||||||
|
model.attr("queuesList", queueService.list(
|
||||||
|
new Search(Queue.TENANT_ID, tenantId)));
|
||||||
|
|
||||||
|
if (arg.getType() == ArgQuery.Type.LIST) {
|
||||||
|
model.setAttr("areaCodes", areaCodeService.list(null));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package com.pudonghot.yo.cms.controller;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.BaseUpdateForm;
|
||||||
|
import com.pudonghot.yo.cms.form.create.CreateFormTrunkProhibitedAreaCode;
|
||||||
|
import com.wacai.tigon.form.FormList;
|
||||||
|
import com.wacai.tigon.web.annotation.ListApi;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import com.wacai.tigon.web.annotation.FilterCol;
|
||||||
|
import com.wacai.tigon.web.controller.BaseCrudController;
|
||||||
|
import com.pudonghot.yo.cms.annotation.TenantResource;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import com.pudonghot.yo.model.domain.TrunkProhibitedAreaCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 30, 2019 19:01:50
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@ListApi(searchCols = {
|
||||||
|
TrunkProhibitedAreaCode.NOTE
|
||||||
|
},
|
||||||
|
filterCols = {
|
||||||
|
@FilterCol(param = TrunkProhibitedAreaCode.ACTIVE, type = boolean.class)
|
||||||
|
})
|
||||||
|
@TenantResource
|
||||||
|
@RequestMapping("/trunk-prohibited-area-code")
|
||||||
|
public class TrunkProhibitedAreaCodeController
|
||||||
|
extends BaseCrudController<Integer,
|
||||||
|
TrunkProhibitedAreaCode,
|
||||||
|
FormList,
|
||||||
|
CreateFormTrunkProhibitedAreaCode,
|
||||||
|
BaseUpdateForm> {
|
||||||
|
}
|
@ -0,0 +1,52 @@
|
|||||||
|
package com.pudonghot.yo.cms.controller;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.create.CreateFormTrunkStrategy;
|
||||||
|
import com.pudonghot.yo.cms.form.update.UpdateFormTrunkStrategy;
|
||||||
|
import com.wacai.tigon.form.FormList;
|
||||||
|
import com.wacai.tigon.model.ViewModel;
|
||||||
|
import com.wacai.tigon.web.controller.ArgQuery;
|
||||||
|
import com.wacai.tigon.web.annotation.ListApi;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import com.wacai.tigon.web.annotation.FilterCol;
|
||||||
|
import com.pudonghot.yo.model.domain.TrunkStrategy;
|
||||||
|
import com.wacai.tigon.web.controller.BaseCrudController;
|
||||||
|
import com.pudonghot.yo.cms.annotation.TenantResource;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 30, 2019 19:01:50
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@ListApi(searchCols = {
|
||||||
|
TrunkStrategy.NAME,
|
||||||
|
TrunkStrategy.NOTE
|
||||||
|
},
|
||||||
|
filterCols = {
|
||||||
|
@FilterCol(param = TrunkStrategy.STRATEGY, type = TrunkStrategy.Strategy.class),
|
||||||
|
@FilterCol(param = TrunkStrategy.ACTIVE, type = boolean.class)
|
||||||
|
})
|
||||||
|
@TenantResource
|
||||||
|
@RequestMapping("/trunk-strategy")
|
||||||
|
public class TrunkStrategyController
|
||||||
|
extends BaseCrudController<Integer,
|
||||||
|
TrunkStrategy,
|
||||||
|
FormList,
|
||||||
|
CreateFormTrunkStrategy,
|
||||||
|
UpdateFormTrunkStrategy> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void after(final ArgQuery<?> arg) {
|
||||||
|
super.after(arg);
|
||||||
|
final ViewModel<?> model = arg.getResult();
|
||||||
|
model.setAttr("strategiesList", TrunkStrategy.Strategy.values());
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/strategies")
|
||||||
|
public TrunkStrategy.Strategy[] strategies() {
|
||||||
|
return TrunkStrategy.Strategy.values();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package com.pudonghot.yo.cms.form;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 25, 2019 14:55:34
|
||||||
|
*/
|
||||||
|
@Setter
|
||||||
|
@Getter
|
||||||
|
public class BaseBatchForm extends BasicForm implements SessionForm {
|
||||||
|
@NotNull
|
||||||
|
@NotEmpty
|
||||||
|
private Integer[] ids;
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
package com.pudonghot.yo.cms.form;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import com.wacai.tigon.form.FormCreateApi;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Jun 21, 2017 18:01
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public class BaseCreateForm extends BasicForm implements FormCreateApi {
|
||||||
|
@NotBlank
|
||||||
|
private String createdBy;
|
||||||
|
@Setter
|
||||||
|
private boolean active = true;
|
||||||
|
@Setter
|
||||||
|
private String note;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set login user
|
||||||
|
* @param loginUser login user
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void setAuthUser(final String loginUser) {
|
||||||
|
setCreatedBy(loginUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreatedBy(final String createdBy) {
|
||||||
|
super.setAuthUser(createdBy);
|
||||||
|
this.createdBy = createdBy;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,42 @@
|
|||||||
|
package com.pudonghot.yo.cms.form;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import com.wacai.tigon.form.FU0;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Jun 21, 2017 18:05
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public class BaseUpdateForm extends FU0<Integer> implements SessionForm {
|
||||||
|
@Setter
|
||||||
|
@NotNull
|
||||||
|
private Integer tenantId;
|
||||||
|
@Setter
|
||||||
|
@NotBlank
|
||||||
|
private String tenantCode;
|
||||||
|
@NotBlank
|
||||||
|
private String authUser;
|
||||||
|
@NotBlank
|
||||||
|
private String updatedBy;
|
||||||
|
@Setter
|
||||||
|
private boolean active;
|
||||||
|
@Setter
|
||||||
|
private String note;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void setAuthUser(final String authUser) {
|
||||||
|
setUpdatedBy(authUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpdatedBy(final String updatedBy) {
|
||||||
|
this.authUser = updatedBy;
|
||||||
|
this.updatedBy = updatedBy;
|
||||||
|
}
|
||||||
|
}
|
24
cms/src/main/java/com/pudonghot/yo/cms/form/BasicForm.java
Normal file
24
cms/src/main/java/com/pudonghot/yo/cms/form/BasicForm.java
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
package com.pudonghot.yo.cms.form;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import com.wacai.tigon.form.BaseForm;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import lombok.experimental.FieldNameConstants;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Jun 21, 2017 18:01
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@FieldNameConstants(prefix = "")
|
||||||
|
public class BasicForm extends BaseForm implements SessionForm {
|
||||||
|
@NotNull
|
||||||
|
private Integer tenantId;
|
||||||
|
@NotBlank
|
||||||
|
private String tenantCode;
|
||||||
|
@NotBlank
|
||||||
|
private String authUser;
|
||||||
|
}
|
17
cms/src/main/java/com/pudonghot/yo/cms/form/BatchForm.java
Normal file
17
cms/src/main/java/com/pudonghot/yo/cms/form/BatchForm.java
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
package com.pudonghot.yo.cms.form;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import java.util.List;
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Jun 21, 2017 18:01
|
||||||
|
*/
|
||||||
|
@Setter
|
||||||
|
@Getter
|
||||||
|
public class BatchForm<T> extends BasicForm {
|
||||||
|
@NotEmpty
|
||||||
|
private List<T> ids;
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.pudonghot.yo.cms.form;
|
||||||
|
|
||||||
|
import com.wacai.tigon.form.FormList;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author bingpo
|
||||||
|
* @date 2020/3/30 下午5:09
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class CallDetailRecordListForm extends FormList {
|
||||||
|
|
||||||
|
private Date startDate;
|
||||||
|
private Date endDate;
|
||||||
|
private String connId;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.pudonghot.yo.cms.form;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author bingpo
|
||||||
|
* @date 2020/3/30 下午2:19
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class RobotConfigForm {
|
||||||
|
private Boolean robotConfig;
|
||||||
|
private Boolean robotFetchData;
|
||||||
|
private String robotResultTopic;
|
||||||
|
private Integer robotStateMachineId;
|
||||||
|
private Boolean robotFetchLocal;
|
||||||
|
private String robotFetchUrl;
|
||||||
|
private String robotFetchHeader;
|
||||||
|
}
|
45
cms/src/main/java/com/pudonghot/yo/cms/form/SessionForm.java
Normal file
45
cms/src/main/java/com/pudonghot/yo/cms/form/SessionForm.java
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
package com.pudonghot.yo.cms.form;
|
||||||
|
|
||||||
|
import com.wacai.tigon.form.BaseFormApi;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 15, 2019 21:27:22
|
||||||
|
*/
|
||||||
|
public interface SessionForm extends BaseFormApi {
|
||||||
|
/**
|
||||||
|
* get tenant id
|
||||||
|
* @return tenant id
|
||||||
|
*/
|
||||||
|
Integer getTenantId();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set tenant id
|
||||||
|
* @param tenantId tenant id
|
||||||
|
*/
|
||||||
|
void setTenantId(Integer tenantId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get tenant code
|
||||||
|
* @return tenant code
|
||||||
|
*/
|
||||||
|
String getTenantCode();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set tenant code
|
||||||
|
* @param tenantCode tenant code
|
||||||
|
*/
|
||||||
|
void setTenantCode(String tenantCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get auth user
|
||||||
|
* @return auth user
|
||||||
|
*/
|
||||||
|
String getAuthUser();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set auth user
|
||||||
|
* @param authUser auth user
|
||||||
|
*/
|
||||||
|
void setAuthUser(String authUser);
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.pudonghot.yo.cms.form;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 15, 2019 22:44:17
|
||||||
|
*/
|
||||||
|
public interface TaggableForm {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get tags
|
||||||
|
* @return tags
|
||||||
|
*/
|
||||||
|
Integer[] getTags();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set tags
|
||||||
|
* @param tags tags
|
||||||
|
*/
|
||||||
|
void setTags(Integer[] tags);
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.create;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.BaseCreateForm;
|
||||||
|
import com.wacai.tigon.format.annotation.Trim;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author: qiushui
|
||||||
|
* @date: 2020-03-16 16:26
|
||||||
|
*/
|
||||||
|
@Setter
|
||||||
|
@Getter
|
||||||
|
public class BatchCreateFromNlpNodeSample extends BaseCreateForm{
|
||||||
|
@NotNull
|
||||||
|
private Integer nodeId;
|
||||||
|
@NotNull
|
||||||
|
private Integer componentId;
|
||||||
|
@Trim
|
||||||
|
@NotBlank(message = "样本不能为空")
|
||||||
|
private String sampleTexts;
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.create;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import com.wacai.tigon.format.annotation.Trim;
|
||||||
|
import com.pudonghot.yo.model.domain.Agent;
|
||||||
|
import org.hibernate.validator.constraints.Range;
|
||||||
|
import com.pudonghot.yo.cms.form.TaggableForm;
|
||||||
|
import com.pudonghot.yo.cms.form.BaseCreateForm;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 02, 2019 12:51:22
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class CreateFormAgent extends BaseCreateForm implements TaggableForm {
|
||||||
|
@NotNull
|
||||||
|
private Integer groupId;
|
||||||
|
@NotNull
|
||||||
|
private Agent.Type type;
|
||||||
|
private boolean webrtc;
|
||||||
|
@Trim
|
||||||
|
@NotBlank
|
||||||
|
private String name;
|
||||||
|
@Trim
|
||||||
|
@NotBlank
|
||||||
|
private String account;
|
||||||
|
@Range(min = 0, max = 120)
|
||||||
|
private int wrapUpTime;
|
||||||
|
private Integer[] queues;
|
||||||
|
private Integer[] tags;
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.create;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.model.domain.AgentGroup;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import com.wacai.tigon.format.annotation.Trim;
|
||||||
|
import com.pudonghot.yo.cms.form.TaggableForm;
|
||||||
|
import com.pudonghot.yo.cms.form.BaseCreateForm;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 16, 2019 11:27:56
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class CreateFormAgentGroup extends BaseCreateForm implements TaggableForm {
|
||||||
|
@Trim
|
||||||
|
@NotBlank
|
||||||
|
private String name;
|
||||||
|
private AgentGroup.PrivacyLevel privacyLevel;
|
||||||
|
private Integer[] trunkStrategies;
|
||||||
|
private Integer[] tags;
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.create;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.BaseCreateForm;
|
||||||
|
import com.pudonghot.yo.cms.form.TaggableForm;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import com.wacai.tigon.format.annotation.Trim;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 15, 2019 19:12:48
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class CreateFormAreaCode extends BaseCreateForm implements TaggableForm {
|
||||||
|
|
||||||
|
@Trim
|
||||||
|
@NotBlank
|
||||||
|
private String code;
|
||||||
|
@Trim
|
||||||
|
@NotBlank
|
||||||
|
private String city;
|
||||||
|
private Integer[] tags;
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.create;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.Pattern;
|
||||||
|
import com.wacai.tigon.format.annotation.Trim;
|
||||||
|
import com.pudonghot.yo.cms.form.TaggableForm;
|
||||||
|
import com.pudonghot.yo.cms.form.BaseCreateForm;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Dec 24, 2019 16:48:12
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class CreateFormAuthPermission extends BaseCreateForm implements TaggableForm {
|
||||||
|
@Trim
|
||||||
|
@NotBlank
|
||||||
|
@Pattern(regexp = "^\\w+$")
|
||||||
|
private String permission;
|
||||||
|
private Integer[] roles;
|
||||||
|
private Integer[] tags;
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.create;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.TaggableForm;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import javax.validation.constraints.Pattern;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import com.wacai.tigon.format.annotation.Trim;
|
||||||
|
import com.pudonghot.yo.cms.form.BaseCreateForm;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Dec 24, 2019 16:43:31
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class CreateFormAuthRole extends BaseCreateForm implements TaggableForm {
|
||||||
|
@Trim
|
||||||
|
@NotBlank
|
||||||
|
@Pattern(regexp = "^\\w+$")
|
||||||
|
private String role;
|
||||||
|
private Integer[] tags;
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.create;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import com.wacai.tigon.format.annotation.Trim;
|
||||||
|
import com.pudonghot.yo.cms.form.TaggableForm;
|
||||||
|
import com.pudonghot.yo.cms.form.BaseCreateForm;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Dec 24, 2019 16:43:24
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class CreateFormAuthUser extends BaseCreateForm implements TaggableForm {
|
||||||
|
@Trim
|
||||||
|
@NotBlank
|
||||||
|
private String name;
|
||||||
|
@Trim
|
||||||
|
@NotBlank
|
||||||
|
private String account;
|
||||||
|
private boolean admin;
|
||||||
|
private Integer[] tenants;
|
||||||
|
private Integer[] roles;
|
||||||
|
private Integer[] tags;
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.create;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.BaseCreateForm;
|
||||||
|
import com.pudonghot.yo.model.domain.CallingList;
|
||||||
|
import com.wacai.tigon.format.annotation.Trim;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author bingpo
|
||||||
|
* @date 2020/3/16 下午3:46
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class CreateFormCallingList extends BaseCreateForm {
|
||||||
|
@NotNull
|
||||||
|
private Integer campaignId;
|
||||||
|
@Trim
|
||||||
|
@NotBlank
|
||||||
|
private String phone;
|
||||||
|
private CallingList.Status status;
|
||||||
|
private Integer dailyFrom;
|
||||||
|
private Integer dailyTo;
|
||||||
|
private String taskKey;
|
||||||
|
private String recordKey;
|
||||||
|
private String recordData;
|
||||||
|
private String attachedData;
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.create;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import com.wacai.tigon.format.annotation.Trim;
|
||||||
|
import com.pudonghot.yo.model.domain.Campaign;
|
||||||
|
import com.pudonghot.yo.cms.form.TaggableForm;
|
||||||
|
import com.pudonghot.yo.cms.form.BaseCreateForm;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 16, 2019 11:27:56
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class CreateFormCampaign extends BaseCreateForm implements TaggableForm {
|
||||||
|
@Trim
|
||||||
|
@NotBlank
|
||||||
|
private String name;
|
||||||
|
@NotNull
|
||||||
|
private Campaign.Type type;
|
||||||
|
@Trim
|
||||||
|
@NotBlank
|
||||||
|
private String target;
|
||||||
|
private Integer[] trunkStrategies;
|
||||||
|
private Integer[] tags;
|
||||||
|
private Boolean robotConfig;
|
||||||
|
private Boolean robotFetchData;
|
||||||
|
private String robotResultTopic;
|
||||||
|
private Integer robotStateMachineId;
|
||||||
|
private Boolean robotFetchLocal;
|
||||||
|
private String robotFetchUrl;
|
||||||
|
private String robotFetchHeader;
|
||||||
|
}
|
@ -0,0 +1,118 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.create;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.BaseCreateForm;
|
||||||
|
import com.wacai.tigon.format.annotation.Trim;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 01, 2019 16:11:13
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class CreateFormGateway extends BaseCreateForm {
|
||||||
|
/**
|
||||||
|
* Gateway name
|
||||||
|
*/
|
||||||
|
@Trim
|
||||||
|
@NotBlank
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Auth realm: *optional* same as gateway name, if blank
|
||||||
|
*/
|
||||||
|
private String realm;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Account username *required*
|
||||||
|
*/
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Account password *required*
|
||||||
|
*/
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Username to use in from: *optional* same as username, if blank
|
||||||
|
*/
|
||||||
|
private String fromUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Domain to use in from: *optional* same as realm, if blank
|
||||||
|
*/
|
||||||
|
private String fromDomain;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extension for inbound calls: *optional* same as username, if blank
|
||||||
|
*/
|
||||||
|
private String extension;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Proxy host: *optional* same as realm, if blank
|
||||||
|
*/
|
||||||
|
private String proxy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send register to this proxy: *optional* same as proxy, if blank
|
||||||
|
*/
|
||||||
|
private String registerProxy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Expire in seconds: *optional* 3600, if blank
|
||||||
|
*/
|
||||||
|
private String expireSeconds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Do not register
|
||||||
|
*/
|
||||||
|
private String register;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Which transport to use for register
|
||||||
|
*/
|
||||||
|
private String registerTransport;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* how many seconds before a retry when a failure or timeout occurs
|
||||||
|
*/
|
||||||
|
private String retrySeconds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use the callerid of an inbound call in the from field on outbound calls via this gateway
|
||||||
|
*/
|
||||||
|
private String callerIdInFrom;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extra sip params to send in the contact
|
||||||
|
*/
|
||||||
|
private String contactParams;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Put the extension in the contact
|
||||||
|
*/
|
||||||
|
private String extensionInContact;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send an options ping every x seconds, failure will unregister and/or mark it down
|
||||||
|
*/
|
||||||
|
private String ping;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CID type
|
||||||
|
*/
|
||||||
|
private String cidType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RFC5626 : Abilitazione rfc5626
|
||||||
|
*/
|
||||||
|
private String rfc5626;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RFC5626 : extra sip params to send in the contact
|
||||||
|
*/
|
||||||
|
private String regId;
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.create;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import com.pudonghot.yo.cms.form.BaseCreateForm;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 16, 2019 12:40:42
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class CreateFormQueue extends BaseCreateForm {
|
||||||
|
@NotBlank
|
||||||
|
private String name;
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.create;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.BaseCreateForm;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author qiushui <br>
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class CreateFormRobotAgent extends BaseCreateForm {
|
||||||
|
@NotNull
|
||||||
|
private Integer[] agentIds;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,29 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.create;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import javax.validation.constraints.Min;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Pattern;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import com.wacai.tigon.format.annotation.Trim;
|
||||||
|
import com.pudonghot.yo.cms.form.BaseCreateForm;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 02, 2019 13:44:03
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class CreateFormSequence extends BaseCreateForm {
|
||||||
|
@Trim
|
||||||
|
@NotBlank
|
||||||
|
@Pattern(regexp = "^\\w+$", message = "序列名必须是字母数字下划线构成")
|
||||||
|
private String name;
|
||||||
|
@Min(1)
|
||||||
|
@NotNull
|
||||||
|
private Long initVal;
|
||||||
|
@Min(1)
|
||||||
|
@NotNull
|
||||||
|
private Long step;
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.create;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import com.pudonghot.yo.model.domain.Tag;
|
||||||
|
import com.wacai.tigon.format.annotation.Trim;
|
||||||
|
import com.pudonghot.yo.cms.form.BaseCreateForm;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 01, 2019 16:11:13
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class CreateFormTag extends BaseCreateForm {
|
||||||
|
@Trim
|
||||||
|
@NotBlank
|
||||||
|
private String tag;
|
||||||
|
@Trim
|
||||||
|
@NotBlank
|
||||||
|
private String bgcolor;
|
||||||
|
@NotNull
|
||||||
|
private Tag.Scope scope;
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.create;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.BaseCreateForm;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import com.wacai.tigon.format.annotation.Trim;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 01, 2019 16:11:13
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class CreateFormTelecomVendor extends BaseCreateForm {
|
||||||
|
@Trim
|
||||||
|
@NotBlank
|
||||||
|
private String name;
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.create;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import com.wacai.tigon.format.annotation.Trim;
|
||||||
|
import com.pudonghot.yo.cms.form.BaseCreateForm;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 01, 2019 16:11:13
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class CreateFormTenant extends BaseCreateForm {
|
||||||
|
@Trim
|
||||||
|
@NotBlank
|
||||||
|
private String name;
|
||||||
|
@Trim
|
||||||
|
@NotBlank
|
||||||
|
private String code;
|
||||||
|
@Trim
|
||||||
|
@NotBlank
|
||||||
|
private String realm;
|
||||||
|
}
|
@ -0,0 +1,79 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.create;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.TaggableForm;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import com.wacai.tigon.format.annotation.Trim;
|
||||||
|
import com.pudonghot.yo.model.domain.Trunk;
|
||||||
|
import com.pudonghot.yo.cms.form.BaseCreateForm;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 02, 2019 12:29:33
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class CreateFormTrunk extends BaseCreateForm implements TaggableForm {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 语音厂商ID
|
||||||
|
*/
|
||||||
|
@NotNull
|
||||||
|
private Integer telecomVendorId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网关ID
|
||||||
|
*/
|
||||||
|
@NotNull
|
||||||
|
private Integer gatewayId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网关(SBC)前缀
|
||||||
|
*/
|
||||||
|
@Trim
|
||||||
|
private String gatewayPrefix;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主叫(显示)号码
|
||||||
|
*/
|
||||||
|
@Trim
|
||||||
|
@NotBlank
|
||||||
|
private String callerNumbers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CPN截除区号
|
||||||
|
*/
|
||||||
|
private boolean cpnWithOutAreaCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外埠号码加拨0
|
||||||
|
*/
|
||||||
|
private boolean ocAddZero;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进线目标类型
|
||||||
|
*/
|
||||||
|
private Trunk.InboundTargetType inboundTargetType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进线目标
|
||||||
|
*/
|
||||||
|
private Integer inboundTarget;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标签
|
||||||
|
*/
|
||||||
|
private Integer[] tags;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 策略
|
||||||
|
*/
|
||||||
|
private Integer[] strategies;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 属性
|
||||||
|
*/
|
||||||
|
private Integer[] attrs;
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.create;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
|
import com.wacai.tigon.format.annotation.Trim;
|
||||||
|
import com.pudonghot.yo.cms.form.BaseCreateForm;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Jan 17, 2020 15:24:23
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class CreateFormTrunkAttr extends BaseCreateForm {
|
||||||
|
@Trim
|
||||||
|
@NotBlank
|
||||||
|
private String attr;
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.create;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import com.pudonghot.yo.cms.form.BaseCreateForm;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 02, 2019 12:29:33
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class CreateFormTrunkProhibitedAreaCode extends BaseCreateForm {
|
||||||
|
@NotNull
|
||||||
|
private Integer trunkId;
|
||||||
|
@NotNull
|
||||||
|
@NotEmpty
|
||||||
|
private String[] areaCodes;
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.create;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import com.pudonghot.yo.cms.form.BaseCreateForm;
|
||||||
|
import com.pudonghot.yo.model.domain.TrunkStrategy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 16, 2019 11:27:56
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class CreateFormTrunkStrategy extends BaseCreateForm {
|
||||||
|
@NotBlank
|
||||||
|
private String name;
|
||||||
|
private TrunkStrategy.Strategy strategy;
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.update;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import com.wacai.tigon.format.annotation.Trim;
|
||||||
|
import com.pudonghot.yo.model.domain.Agent;
|
||||||
|
import org.hibernate.validator.constraints.Range;
|
||||||
|
import com.pudonghot.yo.cms.form.TaggableForm;
|
||||||
|
import com.pudonghot.yo.cms.form.BaseUpdateForm;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 02, 2019 12:51:33
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class UpdateFormAgent extends BaseUpdateForm implements TaggableForm {
|
||||||
|
@NotNull
|
||||||
|
private Integer groupId;
|
||||||
|
@NotNull
|
||||||
|
private Agent.Type type;
|
||||||
|
private boolean webrtc;
|
||||||
|
@Trim
|
||||||
|
@NotBlank
|
||||||
|
private String name;
|
||||||
|
@Range(min = 0, max = 120)
|
||||||
|
private int wrapUpTime;
|
||||||
|
private boolean updatePassword;
|
||||||
|
private Integer[] queues;
|
||||||
|
private Integer[] tags;
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.update;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.BaseUpdateForm;
|
||||||
|
import com.pudonghot.yo.cms.form.TaggableForm;
|
||||||
|
import com.pudonghot.yo.model.domain.AgentGroup;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 16, 2019 11:28:20
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class UpdateFormAgentGroup extends BaseUpdateForm implements TaggableForm {
|
||||||
|
@NotBlank
|
||||||
|
private String name;
|
||||||
|
private AgentGroup.PrivacyLevel privacyLevel;
|
||||||
|
private Integer[] trunkStrategies;
|
||||||
|
private Integer[] tags;
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.update;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.BaseUpdateForm;
|
||||||
|
import com.pudonghot.yo.cms.form.TaggableForm;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import com.wacai.tigon.format.annotation.Trim;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 15, 2019 19:13:24
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class UpdateFormAreaCode extends BaseUpdateForm implements TaggableForm {
|
||||||
|
@Trim
|
||||||
|
@NotBlank
|
||||||
|
private String city;
|
||||||
|
private Integer[] tags;
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.update;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.BaseUpdateForm;
|
||||||
|
import com.pudonghot.yo.cms.form.TaggableForm;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Dec 24, 2019 16:48:29
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class UpdateFormAuthPermission extends BaseUpdateForm implements TaggableForm {
|
||||||
|
private Integer[] tags;
|
||||||
|
private Integer[] roles;
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.update;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.BaseUpdateForm;
|
||||||
|
import com.pudonghot.yo.cms.form.TaggableForm;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Dec 24, 2019 16:46:38
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class UpdateFormAuthRole extends BaseUpdateForm implements TaggableForm {
|
||||||
|
private Integer[] tags;
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.update;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.BaseUpdateForm;
|
||||||
|
import com.pudonghot.yo.cms.form.TaggableForm;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import com.wacai.tigon.format.annotation.Trim;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 02, 2019 12:51:33
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class UpdateFormAuthUser extends BaseUpdateForm implements TaggableForm {
|
||||||
|
@Trim
|
||||||
|
@NotBlank
|
||||||
|
private String name;
|
||||||
|
private boolean admin;
|
||||||
|
private Integer[] tenants;
|
||||||
|
private Integer[] roles;
|
||||||
|
private Integer[] tags;
|
||||||
|
}
|
@ -0,0 +1,37 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.update;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.BaseUpdateForm;
|
||||||
|
import com.pudonghot.yo.model.domain.CallingList;
|
||||||
|
import com.wacai.tigon.format.annotation.Trim;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author bingpo
|
||||||
|
* @date 2020/3/16 下午3:46
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class UpdateFormCallingList extends BaseUpdateForm {
|
||||||
|
@NotNull
|
||||||
|
private Integer campaignId;
|
||||||
|
@Trim
|
||||||
|
@NotBlank
|
||||||
|
private String phone;
|
||||||
|
private CallingList.Status status;
|
||||||
|
private Integer dailyFrom;
|
||||||
|
private Integer dailyTo;
|
||||||
|
private String callUuid;
|
||||||
|
private Date callStartTime;
|
||||||
|
private Date callEstablishedTime;
|
||||||
|
private Date callEndTime;
|
||||||
|
private String callResult;
|
||||||
|
private String taskKey;
|
||||||
|
private String recordKey;
|
||||||
|
private String recordData;
|
||||||
|
private String attachedData;
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.update;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.BaseUpdateForm;
|
||||||
|
import com.pudonghot.yo.cms.form.TaggableForm;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import com.pudonghot.yo.model.domain.Campaign;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 16, 2019 11:28:20
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class UpdateFormCampaign extends BaseUpdateForm implements TaggableForm {
|
||||||
|
@NotBlank
|
||||||
|
private String name;
|
||||||
|
@NotNull
|
||||||
|
private Campaign.Type type;
|
||||||
|
@NotBlank
|
||||||
|
private String target;
|
||||||
|
private Integer[] trunkStrategies;
|
||||||
|
private Integer[] tags;
|
||||||
|
private Boolean robotConfig;
|
||||||
|
private Boolean robotFetchData;
|
||||||
|
private String robotResultTopic;
|
||||||
|
private Integer robotStateMachineId;
|
||||||
|
private Boolean robotFetchLocal;
|
||||||
|
private String robotFetchUrl;
|
||||||
|
private String robotFetchHeader;
|
||||||
|
}
|
@ -0,0 +1,117 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.update;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.BaseUpdateForm;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import com.wacai.tigon.format.annotation.Trim;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 01, 2019 16:11:46
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class UpdateFormGateway extends BaseUpdateForm {
|
||||||
|
/**
|
||||||
|
* Gateway name
|
||||||
|
*/
|
||||||
|
@Trim
|
||||||
|
@NotBlank
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Auth realm: *optional* same as gateway name, if blank
|
||||||
|
*/
|
||||||
|
private String realm;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Account username *required*
|
||||||
|
*/
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Account password *required*
|
||||||
|
*/
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Username to use in from: *optional* same as username, if blank
|
||||||
|
*/
|
||||||
|
private String fromUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Domain to use in from: *optional* same as realm, if blank
|
||||||
|
*/
|
||||||
|
private String fromDomain;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extension for inbound calls: *optional* same as username, if blank
|
||||||
|
*/
|
||||||
|
private String extension;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Proxy host: *optional* same as realm, if blank
|
||||||
|
*/
|
||||||
|
private String proxy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send register to this proxy: *optional* same as proxy, if blank
|
||||||
|
*/
|
||||||
|
private String registerProxy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Expire in seconds: *optional* 3600, if blank
|
||||||
|
*/
|
||||||
|
private String expireSeconds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Do not register
|
||||||
|
*/
|
||||||
|
private String register;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Which transport to use for register
|
||||||
|
*/
|
||||||
|
private String registerTransport;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* how many seconds before a retry when a failure or timeout occurs
|
||||||
|
*/
|
||||||
|
private String retrySeconds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use the callerid of an inbound call in the from field on outbound calls via this gateway
|
||||||
|
*/
|
||||||
|
private String callerIdInFrom;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extra sip params to send in the contact
|
||||||
|
*/
|
||||||
|
private String contactParams;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Put the extension in the contact
|
||||||
|
*/
|
||||||
|
private String extensionInContact;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send an options ping every x seconds, failure will unregister and/or mark it down
|
||||||
|
*/
|
||||||
|
private String ping;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CID type
|
||||||
|
*/
|
||||||
|
private String cidType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RFC5626 : Abilitazione rfc5626
|
||||||
|
*/
|
||||||
|
private String rfc5626;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RFC5626 : extra sip params to send in the contact
|
||||||
|
*/
|
||||||
|
private String regId;
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.update;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.BaseUpdateForm;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 16, 2019 12:41:14
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class UpdateFormQueue extends BaseUpdateForm {
|
||||||
|
@NotBlank
|
||||||
|
private String name;
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.update;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.BaseUpdateForm;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author qiushui <br>
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class UpdateFormRobotAgent extends BaseUpdateForm {
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.update;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.BaseUpdateForm;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import javax.validation.constraints.Min;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 02, 2019 13:43:56
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class UpdateFormSequence extends BaseUpdateForm {
|
||||||
|
@NotBlank
|
||||||
|
private String name;
|
||||||
|
@Min(1)
|
||||||
|
@NotNull
|
||||||
|
private Long step;
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.update;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.BaseUpdateForm;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import com.pudonghot.yo.model.domain.Tag;
|
||||||
|
import com.wacai.tigon.format.annotation.Trim;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 01, 2019 16:11:46
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class UpdateFormTag extends BaseUpdateForm {
|
||||||
|
@Trim
|
||||||
|
@NotBlank
|
||||||
|
private String tag;
|
||||||
|
@Trim
|
||||||
|
@NotBlank
|
||||||
|
private String bgcolor;
|
||||||
|
@NotNull
|
||||||
|
private Tag.Scope scope;
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.update;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.BaseUpdateForm;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import com.wacai.tigon.format.annotation.Trim;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 01, 2019 16:11:46
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class UpdateFormTelecomVendor extends BaseUpdateForm {
|
||||||
|
@Trim
|
||||||
|
@NotBlank
|
||||||
|
private String name;
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.update;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.BaseUpdateForm;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import com.wacai.tigon.format.annotation.Trim;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 01, 2019 16:11:46
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class UpdateFormTenant extends BaseUpdateForm {
|
||||||
|
@Trim
|
||||||
|
@NotBlank
|
||||||
|
private String name;
|
||||||
|
private boolean renewAccessSecret;
|
||||||
|
}
|
@ -0,0 +1,58 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.update;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.BaseUpdateForm;
|
||||||
|
import com.pudonghot.yo.cms.form.TaggableForm;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import com.pudonghot.yo.model.domain.Trunk;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 01, 2019 16:11:46
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class UpdateFormTrunk extends BaseUpdateForm implements TaggableForm {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网关ID
|
||||||
|
*/
|
||||||
|
@NotNull
|
||||||
|
private Integer gatewayId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网关(SBC)前缀
|
||||||
|
*/
|
||||||
|
private String gatewayPrefix;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外埠号码加拨0
|
||||||
|
*/
|
||||||
|
private boolean ocAddZero;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进线目标类型
|
||||||
|
*/
|
||||||
|
private Trunk.InboundTargetType inboundTargetType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进线目标
|
||||||
|
*/
|
||||||
|
private Integer inboundTarget;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标签
|
||||||
|
*/
|
||||||
|
private Integer[] tags;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 策略
|
||||||
|
*/
|
||||||
|
private Integer[] strategies;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 属性
|
||||||
|
*/
|
||||||
|
private Integer[] attrs;
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.update;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.BaseUpdateForm;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import com.wacai.tigon.format.annotation.Trim;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Jan 17, 2020 15:24:15
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class UpdateFormTrunkAttr extends BaseUpdateForm {
|
||||||
|
@Trim
|
||||||
|
@NotBlank
|
||||||
|
private String attr;
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.pudonghot.yo.cms.form.update;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import com.pudonghot.yo.cms.form.BaseUpdateForm;
|
||||||
|
import com.pudonghot.yo.model.domain.TrunkStrategy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 16, 2019 11:28:20
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class UpdateFormTrunkStrategy extends BaseUpdateForm {
|
||||||
|
@NotBlank
|
||||||
|
private String name;
|
||||||
|
@NotNull
|
||||||
|
private TrunkStrategy.Strategy strategy;
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package com.pudonghot.yo.cms.service;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.create.CreateFormAgentGroup;
|
||||||
|
import com.pudonghot.yo.model.domain.AgentGroup;
|
||||||
|
import com.pudonghot.yo.cms.form.update.UpdateFormAgentGroup;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 16, 2019 11:29:12
|
||||||
|
*/
|
||||||
|
public interface AgentGroupService
|
||||||
|
extends TaggableService<AgentGroup,
|
||||||
|
CreateFormAgentGroup,
|
||||||
|
UpdateFormAgentGroup> {
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
package com.pudonghot.yo.cms.service;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.create.CreateFormAgent;
|
||||||
|
import com.pudonghot.yo.cms.form.update.UpdateFormAgent;
|
||||||
|
import com.pudonghot.yo.model.domain.Agent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 02, 2019 12:52:34
|
||||||
|
*/
|
||||||
|
public interface AgentService
|
||||||
|
extends TaggableService<Agent,
|
||||||
|
CreateFormAgent,
|
||||||
|
UpdateFormAgent> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* find agent of domain
|
||||||
|
* @param domain domain
|
||||||
|
* @param agent agent
|
||||||
|
* @return agent
|
||||||
|
*/
|
||||||
|
Agent findOfDomain(String domain, String agent);
|
||||||
|
}
|
@ -0,0 +1,39 @@
|
|||||||
|
package com.pudonghot.yo.cms.service;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
import javax.validation.constraints.Pattern;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.create.CreateFormAreaCode;
|
||||||
|
import com.pudonghot.yo.cms.form.update.UpdateFormAreaCode;
|
||||||
|
import com.pudonghot.yo.model.domain.AreaCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Jan 09, 2018 19:44:55
|
||||||
|
*/
|
||||||
|
public interface AreaCodeService
|
||||||
|
extends TaggableService<AreaCode,
|
||||||
|
CreateFormAreaCode,
|
||||||
|
UpdateFormAreaCode> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* check area code is valid
|
||||||
|
* @param areaCode area code
|
||||||
|
* @return true if area code is valid
|
||||||
|
*/
|
||||||
|
boolean isValid(@NotBlank @Pattern(regexp = "^\\d{3,4}") String areaCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get area code city
|
||||||
|
* @param areaCode area code
|
||||||
|
* @return city
|
||||||
|
*/
|
||||||
|
String getCity(@NotBlank @Pattern(regexp = "^\\d{3,4}") String areaCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get codes
|
||||||
|
* @return codes
|
||||||
|
*/
|
||||||
|
Set<String> getCodes();
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
package com.pudonghot.yo.cms.service;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.create.CreateFormAuthPermission;
|
||||||
|
import com.pudonghot.yo.cms.form.update.UpdateFormAuthPermission;
|
||||||
|
import com.pudonghot.yo.model.domain.AuthPermission;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 02, 2019 12:52:34
|
||||||
|
*/
|
||||||
|
public interface AuthPermissionService
|
||||||
|
extends TaggableService<AuthPermission,
|
||||||
|
CreateFormAuthPermission,
|
||||||
|
UpdateFormAuthPermission> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* list permissions of auth user
|
||||||
|
* @param account account
|
||||||
|
* @return permissions
|
||||||
|
*/
|
||||||
|
List<String> listOfUser(String account);
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
package com.pudonghot.yo.cms.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.create.CreateFormAuthRole;
|
||||||
|
import com.pudonghot.yo.model.domain.AuthRole;
|
||||||
|
import com.pudonghot.yo.cms.form.update.UpdateFormAuthRole;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Dec 24, 2019 17:02:46
|
||||||
|
*/
|
||||||
|
public interface AuthRoleService
|
||||||
|
extends TaggableService<AuthRole,
|
||||||
|
CreateFormAuthRole,
|
||||||
|
UpdateFormAuthRole> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* list roles of user
|
||||||
|
* @param account user account
|
||||||
|
* @return roles
|
||||||
|
*/
|
||||||
|
List<String> listOfUser(String account);
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package com.pudonghot.yo.cms.service;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.create.CreateFormAuthUser;
|
||||||
|
import com.pudonghot.yo.model.domain.AuthUser;
|
||||||
|
import com.pudonghot.yo.cms.form.update.UpdateFormAuthUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Dec 24, 2019 16:50:15
|
||||||
|
*/
|
||||||
|
public interface AuthUserService
|
||||||
|
extends TaggableService<AuthUser,
|
||||||
|
CreateFormAuthUser,
|
||||||
|
UpdateFormAuthUser> {
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package com.pudonghot.yo.cms.service;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.model.domain.CallDetailRecord;
|
||||||
|
import com.wacai.tigon.service.BaseQueryService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author bingpo
|
||||||
|
* @date 2020/3/30 下午3:23
|
||||||
|
*/
|
||||||
|
public interface CallDetailRecordService extends BaseQueryService<Integer, CallDetailRecord> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package com.pudonghot.yo.cms.service;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.create.CreateFormCallingList;
|
||||||
|
import com.pudonghot.yo.cms.form.update.UpdateFormCallingList;
|
||||||
|
import com.pudonghot.yo.model.domain.CallingList;
|
||||||
|
import com.wacai.tigon.service.BaseCrudByFormService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author bingpo
|
||||||
|
* @date 2020/3/16 下午3:46
|
||||||
|
*/
|
||||||
|
public interface CallingListService
|
||||||
|
extends BaseCrudByFormService<Integer, CallingList,
|
||||||
|
CreateFormCallingList,
|
||||||
|
UpdateFormCallingList> {
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package com.pudonghot.yo.cms.service;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.create.CreateFormCampaign;
|
||||||
|
import com.pudonghot.yo.model.domain.Campaign;
|
||||||
|
import com.pudonghot.yo.cms.form.update.UpdateFormCampaign;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Jan 02, 2020 16:44:02
|
||||||
|
*/
|
||||||
|
public interface CampaignService
|
||||||
|
extends TaggableService<Campaign,
|
||||||
|
CreateFormCampaign,
|
||||||
|
UpdateFormCampaign> {
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package com.pudonghot.yo.cms.service;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.create.CreateFormGateway;
|
||||||
|
import com.pudonghot.yo.cms.form.update.UpdateFormGateway;
|
||||||
|
import com.pudonghot.yo.model.domain.Gateway;
|
||||||
|
import com.wacai.tigon.service.BaseCrudByFormService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 02, 2019 09:58:50
|
||||||
|
*/
|
||||||
|
public interface GatewayService
|
||||||
|
extends BaseCrudByFormService<Integer,
|
||||||
|
Gateway,
|
||||||
|
CreateFormGateway,
|
||||||
|
UpdateFormGateway> {
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package com.pudonghot.yo.cms.service;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.create.CreateFormQueue;
|
||||||
|
import com.pudonghot.yo.cms.form.update.UpdateFormQueue;
|
||||||
|
import com.pudonghot.yo.model.domain.Queue;
|
||||||
|
import com.wacai.tigon.service.BaseCrudByFormService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 16, 2019 12:46:17
|
||||||
|
*/
|
||||||
|
public interface QueueService
|
||||||
|
extends BaseCrudByFormService<Integer,
|
||||||
|
Queue,
|
||||||
|
CreateFormQueue,
|
||||||
|
UpdateFormQueue> {
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package com.pudonghot.yo.cms.service;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.create.CreateFormRobotAgent;
|
||||||
|
import com.pudonghot.yo.cms.form.update.UpdateFormRobotAgent;
|
||||||
|
import com.pudonghot.yo.model.domain.RobotAgent;
|
||||||
|
import com.wacai.tigon.service.BaseCrudByFormService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author: qiushui
|
||||||
|
* @date: 2020-02-27 17:36
|
||||||
|
*/
|
||||||
|
public interface RobotAgentService extends BaseCrudByFormService<Integer,
|
||||||
|
RobotAgent,
|
||||||
|
CreateFormRobotAgent,
|
||||||
|
UpdateFormRobotAgent> {
|
||||||
|
|
||||||
|
void batchCreate(CreateFormRobotAgent form);
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package com.pudonghot.yo.cms.service;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.BaseCreateForm;
|
||||||
|
import com.pudonghot.yo.cms.form.BaseUpdateForm;
|
||||||
|
import com.pudonghot.yo.model.domain.RobotCallResult;
|
||||||
|
import com.wacai.tigon.service.BaseCrudByFormService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author: qiushui
|
||||||
|
* @date: 2020-02-27 17:36
|
||||||
|
*/
|
||||||
|
public interface RobotCallResultService extends BaseCrudByFormService<Integer,
|
||||||
|
RobotCallResult,
|
||||||
|
BaseCreateForm,
|
||||||
|
BaseUpdateForm> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
package com.pudonghot.yo.cms.service;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.create.CreateFormSequence;
|
||||||
|
import com.pudonghot.yo.cms.form.update.UpdateFormSequence;
|
||||||
|
import com.pudonghot.yo.model.domain.Sequence;
|
||||||
|
import com.wacai.tigon.service.BaseCrudByFormService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 02, 2019 12:28:36
|
||||||
|
*/
|
||||||
|
public interface SequenceService
|
||||||
|
extends BaseCrudByFormService<Integer,
|
||||||
|
Sequence,
|
||||||
|
CreateFormSequence,
|
||||||
|
UpdateFormSequence> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* next seq val
|
||||||
|
* @param tenantId tenant id
|
||||||
|
* @param name seq name
|
||||||
|
* @return next seq val
|
||||||
|
*/
|
||||||
|
Long nextVal(Integer tenantId, String name);
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package com.pudonghot.yo.cms.service;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.create.CreateFormTag;
|
||||||
|
import com.pudonghot.yo.cms.form.update.UpdateFormTag;
|
||||||
|
import com.pudonghot.yo.model.domain.Tag;
|
||||||
|
import com.wacai.tigon.service.BaseCrudByFormService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 14, 2019 12:03:19
|
||||||
|
*/
|
||||||
|
public interface TagService
|
||||||
|
extends BaseCrudByFormService<Integer,
|
||||||
|
Tag,
|
||||||
|
CreateFormTag,
|
||||||
|
UpdateFormTag> {
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package com.pudonghot.yo.cms.service;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.SessionForm;
|
||||||
|
import com.pudonghot.yo.cms.form.TaggableForm;
|
||||||
|
import com.wacai.tigon.form.FormCreateApi;
|
||||||
|
import com.wacai.tigon.form.FormUpdateApi;
|
||||||
|
import com.wacai.tigon.service.BaseCrudByFormService;
|
||||||
|
import com.pudonghot.yo.model.domain.TaggableDomain;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 16, 2019 10:06:43
|
||||||
|
*/
|
||||||
|
public interface TaggableService<Model extends TaggableDomain,
|
||||||
|
FormCreate extends FormCreateApi & SessionForm & TaggableForm,
|
||||||
|
FormUpdate extends FormUpdateApi<Integer> & SessionForm & TaggableForm>
|
||||||
|
extends BaseCrudByFormService<Integer, Model, FormCreate, FormUpdate> {
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package com.pudonghot.yo.cms.service;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.create.CreateFormTelecomVendor;
|
||||||
|
import com.pudonghot.yo.cms.form.update.UpdateFormTelecomVendor;
|
||||||
|
import com.wacai.tigon.service.BaseCrudByFormService;
|
||||||
|
import com.pudonghot.yo.model.domain.TelecomVendor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Nov 01, 2019 22:48:10
|
||||||
|
*/
|
||||||
|
public interface TelecomVendorService
|
||||||
|
extends BaseCrudByFormService<Integer,
|
||||||
|
TelecomVendor,
|
||||||
|
CreateFormTelecomVendor,
|
||||||
|
UpdateFormTelecomVendor> {
|
||||||
|
}
|
@ -0,0 +1,50 @@
|
|||||||
|
package com.pudonghot.yo.cms.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.create.CreateFormTenant;
|
||||||
|
import com.pudonghot.yo.model.ValueTextModel;
|
||||||
|
import com.pudonghot.yo.model.domain.Tenant;
|
||||||
|
import com.wacai.tigon.service.BaseCrudByFormService;
|
||||||
|
import com.pudonghot.yo.cms.form.update.UpdateFormTenant;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Oct 26, 2019 15:59:44
|
||||||
|
*/
|
||||||
|
public interface TenantService extends BaseCrudByFormService<Integer, Tenant, CreateFormTenant, UpdateFormTenant> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* switch to tenant
|
||||||
|
* @param tenant tenant
|
||||||
|
*/
|
||||||
|
void switchTo(@NotBlank String account, @NotBlank String tenant);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* return account current bu
|
||||||
|
* @param account account
|
||||||
|
* @return current bu or null
|
||||||
|
*/
|
||||||
|
ValueTextModel<String> current(@NotBlank String account);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clear account bu
|
||||||
|
* @param account account
|
||||||
|
* @return current bu or null
|
||||||
|
*/
|
||||||
|
ValueTextModel<String> clear(@NotBlank String account);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* list tenants of account
|
||||||
|
* @param account account
|
||||||
|
* @return tenants
|
||||||
|
*/
|
||||||
|
List<ValueTextModel<String>> listOfUser(@NotBlank String account);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* list tenants of admin
|
||||||
|
* @return tenants
|
||||||
|
*/
|
||||||
|
List<ValueTextModel<String>> listOfAdmin();
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package com.pudonghot.yo.cms.service;
|
||||||
|
|
||||||
|
import com.pudonghot.yo.cms.form.create.CreateFormTrunkAttr;
|
||||||
|
import com.pudonghot.yo.model.domain.TrunkAttr;
|
||||||
|
import com.wacai.tigon.service.BaseCrudByFormService;
|
||||||
|
import com.pudonghot.yo.cms.form.update.UpdateFormTrunkAttr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Donghuang <br>
|
||||||
|
* Jan 17, 2020 15:24:50
|
||||||
|
*/
|
||||||
|
public interface TrunkAttrService
|
||||||
|
extends BaseCrudByFormService<Integer,
|
||||||
|
TrunkAttr,
|
||||||
|
CreateFormTrunkAttr,
|
||||||
|
UpdateFormTrunkAttr> {
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user