diff --git a/eladmin-common/src/main/java/me/zhengjie/base/BaseDTO.java b/eladmin-common/src/main/java/me/zhengjie/base/BaseDTO.java index 162b43cc..cdd1ee4c 100644 --- a/eladmin-common/src/main/java/me/zhengjie/base/BaseDTO.java +++ b/eladmin-common/src/main/java/me/zhengjie/base/BaseDTO.java @@ -3,7 +3,6 @@ package me.zhengjie.base; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import lombok.Getter; -import lombok.Setter; import org.apache.commons.lang3.builder.ToStringBuilder; import java.io.Serializable; import java.lang.reflect.Field; @@ -14,8 +13,7 @@ import java.sql.Timestamp; * @date 2019-10-24 20:48:53 */ @Getter -@Setter -public class BaseDTO implements Serializable { +public class BaseDTO implements Serializable { @ApiModelProperty(value = "Creator") private String createBy; @@ -31,6 +29,45 @@ public class BaseDTO implements Serializable { @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss") private Timestamp updateTime; + /** + * Method chaining setter for createBy + * @param createBy creator + * @return this instance + */ + public BaseDTO setCreateBy(String createBy) { + this.createBy = createBy; + return this; + } + + /** + * Method chaining setter for updateBy + * @param updateBy updater + * @return this instance + */ + public BaseDTO setUpdateBy(String updateBy) { + this.updateBy = updateBy; + return this; + } + + /** + * Method chaining setter for createTime + * @param createTime creation time + * @return this instance + */ + public BaseDTO setCreateTime(Timestamp createTime) { + this.createTime = createTime; + return this; + } + + /** + * Method chaining setter for updateTime + * @param updateTime update time + * @return this instance + */ + public BaseDTO setUpdateTime(Timestamp updateTime) { + this.updateTime = updateTime; + return this; + } @Override public String toString() { diff --git a/scripts/create-badminton.sh b/scripts/create-badminton.sh new file mode 100755 index 00000000..66724ae2 --- /dev/null +++ b/scripts/create-badminton.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# Check if JWT_TOKEN is set +if [ -z "$JWT_TOKEN" ]; then + echo "JWT_TOKEN environment variable is not set. Please run login.sh first and export the token." + echo "Example: export JWT_TOKEN=\"Bearer eyJhbGciOiJIUzUxMiJ9...\"" + exit 1 +fi + +# Create Badminton sport +curl -X POST "http://localhost:8000/api/sport" \ + -H "Content-Type: application/json" \ + -H "Authorization: $JWT_TOKEN" \ + -d '{ + "name": "Badminton", + "description": "A racquet sport played using racquets to hit a shuttlecock across a net.", + "icon": "badminton-icon", + "sort": 1, + "enabled": true + }' + +echo -e "\nBadminton sport created successfully!" diff --git a/scripts/create-pickleball.sh b/scripts/create-pickleball.sh new file mode 100755 index 00000000..e0b58914 --- /dev/null +++ b/scripts/create-pickleball.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# Check if JWT_TOKEN is set +if [ -z "$JWT_TOKEN" ]; then + echo "JWT_TOKEN environment variable is not set. Please run login.sh first and export the token." + echo "Example: export JWT_TOKEN=\"Bearer eyJhbGciOiJIUzUxMiJ9...\"" + exit 1 +fi + +# Create Pickleball sport +curl -X POST "http://localhost:8000/api/sport" \ + -H "Content-Type: application/json" \ + -H "Authorization: $JWT_TOKEN" \ + -d '{ + "name": "Pickleball", + "description": "A paddle sport that combines elements of tennis, badminton, and table tennis, played with a perforated plastic ball and solid paddles.", + "icon": "pickleball-icon", + "sort": 3, + "enabled": true + }' + +echo -e "\nPickleball sport created successfully!" diff --git a/scripts/create-tennis.sh b/scripts/create-tennis.sh new file mode 100755 index 00000000..fb2bcbd5 --- /dev/null +++ b/scripts/create-tennis.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# Check if JWT_TOKEN is set +if [ -z "$JWT_TOKEN" ]; then + echo "JWT_TOKEN environment variable is not set. Please run login.sh first and export the token." + echo "Example: export JWT_TOKEN=\"Bearer eyJhbGciOiJIUzUxMiJ9...\"" + exit 1 +fi + +# Create Tennis sport +curl -X POST "http://localhost:8000/api/sport" \ + -H "Content-Type: application/json" \ + -H "Authorization: $JWT_TOKEN" \ + -d '{ + "name": "Tennis", + "description": "A racquet sport played between two players or two teams of two players each.", + "icon": "tennis-icon", + "sort": 2, + "enabled": true + }' + +echo -e "\nTennis sport created successfully!" diff --git a/scripts/list-sports.sh b/scripts/list-sports.sh new file mode 100755 index 00000000..c1a301f3 --- /dev/null +++ b/scripts/list-sports.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Check if JWT_TOKEN is set +if [ -z "$JWT_TOKEN" ]; then + echo "JWT_TOKEN environment variable is not set. Please run login.sh first and export the token." + echo "Example: export JWT_TOKEN=\"Bearer eyJhbGciOiJIUzUxMiJ9...\"" + exit 1 +fi + +# List all sports +curl -X GET "http://localhost:8000/api/sport" \ + -H "Content-Type: application/json" \ + -H "Authorization: $JWT_TOKEN" | json_pp + +echo -e "\nSports listed successfully!" diff --git a/scripts/login.sh b/scripts/login.sh new file mode 100755 index 00000000..46bf69c8 --- /dev/null +++ b/scripts/login.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# Login and get JWT token +response=$(curl -s -X POST 'http://localhost:8000/auth/login' \ + -H 'Content-Type: application/json' \ + -d '{ + "username": "admin", + "password": "123456" + }') + +# Extract the token +token=$(echo $response | grep -o '"token":"[^"]*' | sed 's/"token":"//') + +echo "Your JWT token is: $token" +echo "To export this token as an environment variable, run:" +echo "export JWT_TOKEN=\"$token\"" diff --git a/sport/index.vue b/sport/index.vue deleted file mode 100644 index 8dfdd8a2..00000000 --- a/sport/index.vue +++ /dev/null @@ -1,122 +0,0 @@ - - - - - diff --git a/sport/sport.js b/sport/sport.js deleted file mode 100644 index 98f56f4f..00000000 --- a/sport/sport.js +++ /dev/null @@ -1,27 +0,0 @@ -import request from '@/utils/request' - -export function add(data) { - return request({ - url: 'api/sport', - method: 'post', - data - }) -} - -export function del(ids) { - return request({ - url: 'api/sport/', - method: 'delete', - data: ids - }) -} - -export function edit(data) { - return request({ - url: 'api/sport', - method: 'put', - data - }) -} - -export default { add, edit, del } diff --git a/sport/src/main/java/com/srr/domain/Event.java b/sport/src/main/java/com/srr/domain/Event.java index aa337cc8..57ff4a7d 100644 --- a/sport/src/main/java/com/srr/domain/Event.java +++ b/sport/src/main/java/com/srr/domain/Event.java @@ -15,7 +15,7 @@ */ package com.srr.domain; -import com.srr.converter.StringListConverter; +import com.srr.domain.converter.StringListConverter; import com.srr.enumeration.EventStatus; import com.srr.enumeration.Format; import lombok.Getter; diff --git a/sport/src/main/java/com/srr/converter/StringListConverter.java b/sport/src/main/java/com/srr/domain/converter/StringListConverter.java similarity index 97% rename from sport/src/main/java/com/srr/converter/StringListConverter.java rename to sport/src/main/java/com/srr/domain/converter/StringListConverter.java index 2d39f80d..703bd006 100644 --- a/sport/src/main/java/com/srr/converter/StringListConverter.java +++ b/sport/src/main/java/com/srr/domain/converter/StringListConverter.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.srr.converter; +package com.srr.domain.converter; import javax.persistence.AttributeConverter; import javax.persistence.Converter;