New Function #42
closedNew Function #32: [API] API for mobile App
[API] User
Description
1.Git
- KORAIL_STORE/korail_store_user
2.Swagger UI (https://swagger.io/tools/swagger-ui/)
- apply this into API
3.Spec (User sheet on #32)
- 1 회원가입 (SignUp) : add fields (red text)
- 2 비밀번호 확인 (check password) : New
- 3 회원정보 변경 (modify user info): New
- 4 회원탈퇴 (withdraw user): New
- 5 사용자 포인트 현황 (user current point): New
- 6 사용자 포인트 적립 리스트 (user point save list) : New
- 7 사용자 포인트 사용 리스트 (user point use list): New
- 8 사용자 적립금 현황 (user current money): New
- 9 사용자 적립금 적립 리스트 (user money save list) : New
- 10 사용자 적립금 사용 리스트 (user money use list): New
- 11 휴면 해제 (dormant release)
- 12 회원상태 조회 (user status view)
Related issues
Updated by Deca Park almost 2 years ago
- Copied from New Function #41: [API] Review&Recommend added
Updated by Deca Park almost 2 years ago
- Copied to New Function #43: [API] Order added
Updated by bryant bryant almost 2 years ago
- Status changed from New to Resolved
- Assignee changed from bryant bryant to Deca Park
Updated by Deca Park almost 2 years ago
1.휴면 해제 (dormant release) API (NEW)
- Spec (User sheet on #32)
Updated by Deca Park almost 2 years ago
- Status changed from Resolved to Feedback
- Assignee changed from Deca Park to bryant bryant
Updated by bryant bryant almost 2 years ago
- Status changed from Feedback to Resolved
- Assignee changed from bryant bryant to Deca Park
Updated by Deca Park over 1 year ago
[Test Issues]
1.POST /api/signup
1) parameter
- zipcode: remove required
Updated by Deca Park over 1 year ago
- Status changed from Resolved to Feedback
- Assignee changed from Deca Park to bryant bryant
Updated by bryant bryant over 1 year ago
- Status changed from Feedback to Resolved
- Assignee changed from bryant bryant to Deca Park
Updated by Deca Park over 1 year ago
[API] Spec change
1.Spec
- User sheet on #32 (20230620)
2.SignUp (POST /api/signup)
1) Paramter
a) add fields
- anniversary_name / anniversary_date
2) Logic
INSERT st_user.anniversary_name / anniversary_date (NEW)
3.회원 정보 조회 (user info view) (GET /api/user) (NEW)
1) Response
- user_grade_name / gender_name / signup_type_name : set code name (of signup_type)
- concern_station_name : set station name list (ex: 서울역,용산역) by concern_station_code
4.modify user info (PUT /api/user)
1) Paramter
a) add fields - currently, it's NOT applied into UserController logic. (if parameter value is empty, skip UPDATE the column)
- gender / birth_day (NEW)
- anniversary_name / anniversary_date (NEW)
2) Logic
UPDATE st_user with added columns
Updated by Deca Park over 1 year ago
- Status changed from Resolved to Feedback
- Assignee changed from Deca Park to Toby Pham
Updated by Toby Pham over 1 year ago
- Status changed from Feedback to Resolved
- Assignee changed from Toby Pham to Deca Park
Updated by Deca Park over 1 year ago
- Status changed from Resolved to Feedback
- Assignee changed from Deca Park to bryant bryant
Updated by Deca Park over 1 year ago
- Assignee changed from bryant bryant to Toby Pham
Updated by Toby Pham over 1 year ago
- Status changed from Feedback to Resolved
- Assignee changed from Toby Pham to Deca Park
Updated by Deca Park over 1 year ago
- Status changed from Resolved to Feedback
- Assignee changed from Deca Park to bryant bryant
[API] POST /api/login
1.Logic
1) As-is
- if user_status = 'US04', return error (status: 401, error_code: "user.error.dormant")
2) To-be
- SKIP (although user_status = 'US04', can login)
[API] /api/user
1.Resonse
1) user_status / user_status_name (Add)
- set by st_user.user_status
Updated by bryant bryant over 1 year ago
- Status changed from Feedback to Resolved
- Assignee changed from bryant bryant to Deca Park
Updated by bryant bryant over 1 year ago
- Status changed from Feedback to Resolved
- Assignee changed from bryant bryant to Deca Park
Updated by Deca Park over 1 year ago
- Status changed from Resolved to Feedback
- Assignee changed from Deca Park to bryant bryant
1.API (Add) - 회원 포인트 적립 (Save user point) : POST /api/save_point
1) Spec (User sheet of #32 - 20230626)
2) DB (change)
- depart_date / arrive_date : DELETE
2.[API] GET /api/user_point
1) Response
a) today_save_point (Add)
a-1) logic
DB: st_user_save_point
select: SUM(save_point)
conditions: user_seq = {user_seq of id param} AND save_date = {today}
b) today_move_distance (Add)
b-1) logic
DB: st_user_save_point
select: SUM(move_distance)
conditions: user_seq = {user_seq of id param} AND save_date = {today}
c) today_carbon_reduce (Add)
c-1) logic: NOT DEFINED
Updated by bryant bryant over 1 year ago
- Status changed from Feedback to Resolved
- Assignee changed from bryant bryant to Deca Park
Updated by Deca Park over 1 year ago
[API] POST /api/save_point
1.save_point (logic)
- 3.3 원 per 1km (1000m), Max day point : 100 원 per day
+ if point SUM of today is over 100(원), SKIP (don't save point)
+ if point SUM of today is 80(원), can save point until 20(원)
Updated by Deca Park over 1 year ago
- Status changed from Resolved to Feedback
- Assignee changed from Deca Park to bryant bryant
[API] POST /api/signup
1.server error
org.springframework.dao.DataIntegrityViolationException:
### Error updating database. Cause: java.sql.SQLException: Data truncated for column 'event_alarm_yn' at row 1
### The error may involve com.stoneitgt.user.mapper.UserMapper.insert-Inline
### The error occurred while setting parameters
### SQL: insert into st_user (id, password, signup_type, username, gender, birth_day, hp, email, zipcode, address, sub_address, auth, user_status, user_grade, concern_station_code, event_alarm_yn, last_login_date, pw_mod_date, dormant_date, withdraw_date, email_receive_yn, sms_receive_yn, anniversary_name, anniversary_date, reg_user_seq, reg_date) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, NOW())
### Cause: java.sql.SQLException: Data truncated for column 'event_alarm_yn' at row 1
2.test parameters
{
"address": "서울 강서구 강서로 486",
"birth_day": "19930628",
"email": "1021kk@naver.com",
"email_receive_yn": "Y",
"event_alarm_yn": "N",
"gender": "GE01",
"hp": "01094860934",
"id": "test1234",
"password": "1234",
"signup_type": "MJ01",
"sms_receive_yn": "Y",
"sub_address": "123123",
"username": "강민기",
"zipcode": "07530"
}
Updated by bryant bryant over 1 year ago
- Status changed from Feedback to Resolved
- Assignee changed from bryant bryant to Deca Park
Updated by Deca Park over 1 year ago
- Status changed from Resolved to Feedback
- Assignee changed from Deca Park to bryant bryant
[API] GET /api/user_point
1.Response fields
1) today_move_distance
a) change comment with "오늘 이동거리 (km)"
b) change unit (m -> km)
- show value until first decimal point (round up on second decimal point)
- ex) 650m -> 0.7km
ex) 640m -> 0.6km
ex) 500m -> 0.5km
2) today_carbon_reduce (NEW)
= {today_move_distance} (km) * 132g (round up on first decimal point)
ex) 1.5 -> 2g
1.4 -> 1g
Updated by bryant bryant over 1 year ago
- Status changed from Feedback to Resolved
- Assignee changed from bryant bryant to Deca Park
Updated by Deca Park over 1 year ago
[API] GET /api/user_point
1.today_carbon_reduce (Change)
a) change comment: "오늘 탄소저감량 (단위포함: g/kg/t)"
change type: integer -> string (including unit)
b) value
b-1) < 100 (unit: g)
- round up on 1 decimal point
- ex) 1.5 -> 2g, 1.4 -> 1g
b-2) 100 <= value < 10000 (unit: kg)
- ex) value: 100.15
divide 1000: 100.15 / 1000 = 0.15kg
round up on 2 decimal point: 0.15 -> 0.2kg, 0.14 -> 0.1kg
b-3) value >= 10000 (unit: t)
- ex) value: 10000.15
divide 100000: 10000.15 / 100000 = 0.15t
round up on 2 decimal point: 0.15 -> 0.2t, 0.14 -> 0.1t
2.month_move_distance (NEW)
a) Integer / "월누적 이동거리 (km)"
b) value
- SUM of this month's st_user_save_point.move_distance
(ex: today: august-05, august-01 ~ august-05)
- rule is same with today_move_distance
3.month_carbon_reduce (NEW)
a) string / "월누적 탄소저감량 (단위포함:g/kg/t)"
b) value
- compute month_carbon_reduce with SUM of this month's st_user_save_point.move_distance
(ex: today: august-05, august-01 ~ august-05)
- rule is same with today_carbon_reduce