Browse Source
Test using Optional in repository
Test using Optional in repository
Trying out fetching values from repository as Optional. Plus set line length to 80master
Rohan Sircar
4 years ago
13 changed files with 190 additions and 176 deletions
-
7chatto/application.properties
-
38chatto/src/main/java/org/ros/chatto/controller/AdminRESTController.java
-
27chatto/src/main/java/org/ros/chatto/controller/DemoRestController.java
-
11chatto/src/main/java/org/ros/chatto/logged/LoggedUser.java
-
7chatto/src/main/java/org/ros/chatto/repository/UserRepository.java
-
20chatto/src/main/java/org/ros/chatto/security/CustomBasicAuthenticationFilter.java
-
36chatto/src/main/java/org/ros/chatto/service/ChatServiceImpl.java
-
5chatto/src/main/java/org/ros/chatto/service/UserService.java
-
94chatto/src/main/java/org/ros/chatto/service/UserServiceImpl.java
-
5chatto/src/main/java/org/ros/chatto/service/UserTokenService.java
-
74chatto/src/main/javascript/ts/src/singleton/JsonAPI.ts
-
12chatto/src/main/javascript/ts/src/viewmodel/ChatMessageViewModel.ts
-
30config/application.properties
@ -0,0 +1,7 @@ |
|||||
|
## chatto DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties) |
||||
|
chatto.datasource.url = jdbc:mysql://localhost:3306/chatto_db2?useSSL=false |
||||
|
chatto.datasource.username = chatto_user |
||||
|
chatto.datasource.password = password |
||||
|
chatto.datasource.database-name = chatto_db2 |
||||
|
website-url = 192.168.1.13 |
||||
|
test.bindAddress=192.168.1.106 |
@ -1,39 +1,37 @@ |
|||||
export namespace JsonAPI { |
export namespace JsonAPI { |
||||
// @ts-ignore: Cannot find name 'hostAddress'.
|
|
||||
export let principleName: string | null = localStorage.getItem('username'); |
|
||||
export let contactName: string | null; |
|
||||
export let authToken: string | null = localStorage.getItem('authToken'); |
|
||||
export const ACTIVE_USERS_GET = `/api/chat/get/active-users`; |
|
||||
/** |
|
||||
* Json API URL for retrieving all messages between two users |
|
||||
* |
|
||||
* ### With sprintf |
|
||||
* const url = Sprintf(JsonAPI.CHAT_MESSAGES_GET, contactName); |
|
||||
* |
|
||||
* @format /api/chat/get/messages/{contactName} |
|
||||
* @example /api/chat/get/messages/some-user |
|
||||
* |
|
||||
* |
|
||||
* @param contactName |
|
||||
* The user whose messages we wish to retrieve. |
|
||||
*/ |
|
||||
export const CHAT_MESSAGES_GET = `/api/chat/get/messages/%s`; |
|
||||
export const MESSAGE_POST = '/api/chat/post/message'; |
|
||||
/** |
|
||||
* Json API URL for retrieving paginated messages between two users |
|
||||
* Page index starts with 0 |
|
||||
* |
|
||||
* ### With sprintf |
|
||||
* const url = Sprintf(JsonAPI.CHAT_MESSAGES_GET, contactName); |
|
||||
* |
|
||||
* @example /api/chat/get/messages/some-user?page=0&size=5 will give the first page where each page has size 5 |
|
||||
* |
|
||||
* |
|
||||
* |
|
||||
* @param contactName the user whose messages we wish to retrieve |
|
||||
* @param page denotes the page required |
|
||||
* @param size denotes the size of each page |
|
||||
*/ |
|
||||
export const CHAT_MESSAGE_PAGE_GET = `/api/chat/get/messages/%s?page=%d&size=%d`; |
|
||||
|
|
||||
} |
|
||||
|
export let principleName: string = localStorage.getItem("username") || ""; |
||||
|
export let contactName: string = ""; |
||||
|
export let authToken: string = localStorage.getItem("authToken") || ""; |
||||
|
export const ACTIVE_USERS_GET = `/api/chat/get/active-users`; |
||||
|
/** |
||||
|
* Json API URL for retrieving all messages between two users |
||||
|
* |
||||
|
* ### With sprintf |
||||
|
* const url = Sprintf(JsonAPI.CHAT_MESSAGES_GET, contactName); |
||||
|
* |
||||
|
* @format /api/chat/get/messages/{contactName} |
||||
|
* @example /api/chat/get/messages/some-user |
||||
|
* |
||||
|
* |
||||
|
* @param contactName |
||||
|
* The user whose messages we wish to retrieve. |
||||
|
*/ |
||||
|
export const CHAT_MESSAGES_GET = `/api/chat/get/messages/%s`; |
||||
|
export const MESSAGE_POST = "/api/chat/post/message"; |
||||
|
/** |
||||
|
* Json API URL for retrieving paginated messages between two users |
||||
|
* Page index starts with 0 |
||||
|
* |
||||
|
* ### With sprintf |
||||
|
* const url = Sprintf(JsonAPI.CHAT_MESSAGES_GET, contactName); |
||||
|
* |
||||
|
* @example /api/chat/get/messages/some-user?page=0&size=5 will give the first page where each page has size 5 |
||||
|
* |
||||
|
* |
||||
|
* |
||||
|
* @param contactName the user whose messages we wish to retrieve |
||||
|
* @param page denotes the page required |
||||
|
* @param size denotes the size of each page |
||||
|
*/ |
||||
|
export const CHAT_MESSAGE_PAGE_GET = `/api/chat/get/messages/%s?page=%d&size=%d`; |
||||
|
} |
@ -1,8 +1,6 @@ |
|||||
export class ChatMessageViewModel { |
export class ChatMessageViewModel { |
||||
public toUser: string | undefined; |
|
||||
public fromUser: string | undefined; |
|
||||
public message!: string; |
|
||||
public messageTime!: Date; |
|
||||
|
|
||||
|
|
||||
} |
|
||||
|
public toUser: string = ""; |
||||
|
public fromUser: string = ""; |
||||
|
public message: string = ""; |
||||
|
public messageTime: Date = new Date(); |
||||
|
} |
@ -1,23 +1,7 @@ |
|||||
|
|
||||
## Spring DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties) |
|
||||
spring.datasource.url = jdbc:mysql://localhost:3306/chatto_db?useSSL=false |
|
||||
spring.datasource.username = chatto_user |
|
||||
spring.datasource.password = password |
|
||||
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver |
|
||||
|
|
||||
## Hibernate Properties |
|
||||
# The SQL dialect makes Hibernate generate better SQL for the chosen database |
|
||||
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect |
|
||||
|
|
||||
|
|
||||
# Hibernate ddl auto (create, create-drop, validate, update) |
|
||||
spring.jpa.hibernate.ddl-auto = validate |
|
||||
|
|
||||
logging.level.org.springframework.web=DEBUG |
|
||||
logging.level.web=DEBUG |
|
||||
logging.level.org.hibernate.SQL=DEBUG |
|
||||
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE |
|
||||
spring.http.log-request-details=true |
|
||||
#spring.jackson.date-format=yyyy-MM-d |
|
||||
spring.jackson.serialization.write-dates-as-timestamps=false |
|
||||
#spring.mvc.static-path-pattern=/static/** |
|
||||
|
## chatto DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties) |
||||
|
chatto.datasource.url = jdbc:mysql://localhost:3306/chatto_db2?useSSL=false |
||||
|
chatto.datasource.username = chatto_user |
||||
|
chatto.datasource.password = password |
||||
|
chatto.datasource.database-name = chatto_db2 |
||||
|
website-url = 192.168.1.13 |
||||
|
test.bindAddress=192.168.1.106 |
Write
Preview
Loading…
Cancel
Save
Reference in new issue