Comments (7)
CloudBreadPaPa - Working on it.
from cloudbread.
commented CBSelCoupons API
commented install-with-sample.bat - SQLCMD -S %1 -U %2 -P %3 -d %4 -i ./script/uspSelCoupons.sql
commented uspSelCoupons.sql
from cloudbread.
The business logic des fixed in CloudBread project PR #32
#32
This merge request is fix for Coupon module biz logic problem #26 #32
and
CloudBread-DB-Install-Script project PR9
CloudBreadProject/CloudBread-DB-Install-Script#9
This merge request is fix for Coupon module biz logic problem #26 #9
Now, working on Massive coupon generation task.
API의 비즈니스 로직이 맞지 않는 부분 처리 완료.
대량 쿠폰 생성 + 실제 쿠폰 사용시 처리 루틴 작업 시작
from cloudbread.
대량 쿠폰 생성 batch task 파일 작업 중.
/*
@file Massive-coupon-generation.sql
@author Dae Woo Kim
@brief This procedure is build for massive coupon generation admin task purpose.\n
* 이 프로시저는 대량 쿠폰 생성을 위한 관리자 작업
0. 쿠폰은 CloudBread-Admin-Web에서 1개씩 생성 가능. 곧 완료될 CloudBread-Admin-Web 2.0.x 버전에서 대량 생성 기능 + 다운로드 기능 제공 예정
1. CouponID는 랜덤 GUID. GUID가 아닌 다른 줄이기 원할 경우 아래 루프의 newid() 부분을 원하는 패턴으로 변경. 10,000개 생성시 약 5초 내외 소요(Azure SQL Database S1 사이즈 기준)
2. while loop를 수정해 원하는 숫자 생성. 생성시 주의할 점은 반드시 CouponCategory1을 고정시키고 갯수만큼 생성한다.(이번 batch로 생성한 쿠폰들을 식별하기 위해)
3. ItemListID와 ItemCount가 중요 컬럼으로, 쿠폰 사용 루틴에서 해당 item을 추가하는 처리를 한다.
4. ItemListID와 ItemCount는 기본 MemberItems를 처리하지지만, 게임정보인 MemberGameInfoes의 member 값을 수정할 경우에는 ItemListID를 각각 MemberGameInfoes의 "_Level_" 또는 "_Exps_", "_Points_", "_UserSTAT1_", "_sCol1_" 등의 컬럼 값으로 맞추고, ItemCount값을 Coupon에 넣으면, 해당 member의 컬럼 값이 ItemCount 숫자만큼 추가되는 구조
5. Coupon으로 MemberItems에 아이템을 추가할지, MemberGameInfoes의 속성을 수정할지는 uspUdtCouponMember 루틴에서 4번의 ItemListID 값에 따라 분기해 처리된다.
6. 쿠폰 소진을 위해서는 SSMS(SQL Server Management Studio를 이용해 where 조건으로 조회 후 결과를 Excel에 copy & paste 하거나, SSMS 메뉴 Query-Result to file로 결과를 저장해 외부 업체 및 쿠폰 발송 대행업체와 협업 가능(CloudBread-Admin-Web 2.0.x 프로젝트에서는 관리자 페이지에서 기본 제공 예정
7. 커뮤니티나 게시판에 쿠폰 제공을 원할 경우 where 조건으로 생성한 쿠폰들만 조회 후, guid로 생성된 CouponID만 공유해 사용 가능
*/
-- 생성할 쿠폰의 숫자를 수정하고, CouponCategory1의 값을 이후 where condition 조회를 위해 반드시 체크
-- start of batch task
set nocount on
set xact_abort on -- during this tansactional task, coupon table should be locked in couple second for 10,000 coupon generation
begin tran
declare @coupon_count_number as int -- number of coupon to generate
set @coupon_count_number = 1000 -- 1,000 coupon will be generated on Coupons table
declare @i as int -- loop number
set @i = 0
WHILE (select @i) < @coupon_count_number
BEGIN
insert into Coupon(CouponID, CouponCategory1, CouponCategory2, CouponCategory3, ItemListID, ItemCount, ItemStatus, TargetGroup, TargetOS, TargetDevice, Title, Content, sCol1, sCol2, sCol3, sCol4, sCol5, sCol6, sCol7, sCol8, sCol9, sCol10, DupeYN, OrderNumber, CouponDurationFrom, CouponDurationTo, CreateAdminID)
values(newid(), 'Coupon-for-game-install-reservation-1000-event', 'CouponCategory2', 'CouponCategory3', 'itemid1', '1', 'ItemStatus', 'TargetGroup', 'TargetOS', 'TargetDevice', 'Title1', 'Content', 'sCol1', 'sCol2', 'sCol3', 'sCol4', 'sCol5', 'sCol6', 'sCol7', 'sCol8', 'sCol9', 'sCol10', 'N', '0', '2015-03-01', '2025-04-01', 'admin1')
-- add count number
set @i = @i + 1
END
commit tran
GO
/*
-- 카테고리로 이번에 추가한 배치 조회
select * from coupon where CouponCategory1 like 'Coupon-for-game-install-reservation-1000-event'
-- SSMS에서 결과를 복사해 Excel로 외부 Coupon 대리 발송 업체에 제공하거나, 직접 발송시 이용
--전체 데이터 조회
select * from coupon
--테스트 데이터 추가
insert into Coupon(CouponID, CouponCategory1, CouponCategory2, CouponCategory3, ItemListID, ItemCount, ItemStatus, TargetGroup, TargetOS, TargetDevice, Title, Content, sCol1, sCol2, sCol3, sCol4, sCol5, sCol6, sCol7, sCol8, sCol9, sCol10, DupeYN, OrderNumber, CouponDurationFrom, CouponDurationTo, CreateAdminID)
values(newid(), 'Coupon-for-game-install-reservation-1000-event', 'CouponCategory2', 'CouponCategory3', 'itemid1', '1', 'ItemStatus', 'TargetGroup', 'TargetOS', 'TargetDevice', 'Title1', 'Content', 'sCol1', 'sCol2', 'sCol3', 'sCol4', 'sCol5', 'sCol6', 'sCol7', 'sCol8', 'sCol9', 'sCol10', 'N', '0', '2015-03-01', '2025-04-01', 'admin1')
--MemberGameInfoes 의 "사용자 정의 돈"이나 "point등을" 수정하기 위한 샘플 데이터
--Level, Exps, Points, UserSTAT1~10을 변경 가능
insert into Coupon(CouponID, CouponCategory1, CouponCategory2, CouponCategory3, ItemListID, ItemCount, ItemStatus, TargetGroup, TargetOS, TargetDevice, Title, Content, sCol1, sCol2, sCol3, sCol4, sCol5, sCol6, sCol7, sCol8, sCol9, sCol10, DupeYN, OrderNumber, CouponDurationFrom, CouponDurationTo, CreateAdminID)
values(newid(), 'update Exps data of MemberGameInfoes table', 'CouponCategory2', 'CouponCategory3',
'_EXPS_', '5000', 'ItemStatus', 'TargetGroup', 'TargetOS', 'TargetDevice', 'Title1', 'Content', 'sCol1', 'sCol2', 'sCol3', 'sCol4', 'sCol5', 'sCol6', 'sCol7', 'sCol8', 'sCol9', 'sCol10', 'N', '0', '2015-03-01', '2025-04-01', 'admin1')
insert into Coupon(CouponID, CouponCategory1, CouponCategory2, CouponCategory3, ItemListID, ItemCount, ItemStatus, TargetGroup, TargetOS, TargetDevice, Title, Content, sCol1, sCol2, sCol3, sCol4, sCol5, sCol6, sCol7, sCol8, sCol9, sCol10, DupeYN, OrderNumber, CouponDurationFrom, CouponDurationTo, CreateAdminID)
values(newid(), 'update Level data of MemberGameInfoes table', 'CouponCategory2', 'CouponCategory3',
'_LEVEL_', '100', 'ItemStatus', 'TargetGroup', 'TargetOS', 'TargetDevice', 'Title1', 'Content', 'sCol1', 'sCol2', 'sCol3', 'sCol4', 'sCol5', 'sCol6', 'sCol7', 'sCol8', 'sCol9', 'sCol10', 'N', '0', '2015-03-01', '2025-04-01', 'admin1')
-- 카테고리로 이번에 추가한 배치 조회
select * from coupon where CouponCategory1 like 'Coupon-for-game-install-reservation-1000-event'
select * from coupon
truncate table coupon
*/
from cloudbread.
실제 쿠폰 사용시 처리 루틴 작업 처리 중.
이 처리는 uspUdtCouponMember SP와 CBUdtCouponMember API에 대한 수정 작업 필요.
working on it.
from cloudbread.
uspUdtCouponMember 수정 작업 완료.
--GAMEINFO 일 경우 EventMember에 추가하고, GameInfo에 Update
--CouponMember에 추가 수행해 이벤트 CouponMemberID는 GUID로 자동 삽입됨
CBUdtCouponMember API 수정 작업 시작
from cloudbread.
아래의 API call을 이용해 테스트 가능하고, SQL 쿼리 문서를 참고해 테스트 Stored Procedure 를 이용해 데이터 테스트 가능
uspUdtCouponMember Stored Procedure : https://github.com/CloudBreadProject/CloudBread-DB-Install-Script/blob/master/SQL-Script-2.0.0/script/uspUdtCouponMember.sql
포스트맨으로 테스트 가능한 API 콜 예제
adding Postman sample test API call
CBUdtCouponMembe-GAMEINFO
{
"InsertORUpdate": "GAMEINFO", // update to gameinfo table refer - #26
"CouponID_Coupon": "DF8CA626-7BCF-489C-9C6D-85B58B2D6D5D", // ref
"MemberItemID_MemberItems": "", // INSERT : new value, UPDATE : MemberItemID ref value
"MemberID_MemberItems": "aaa", // ref
"ItemListID_MemberItems": "POINTS", // this value is GameInfo table
"ItemCount_MemberItems": "34000", // this is value to add membertem Points value of member
"ItemStatus_MemberItems": "ItemStatus",
"sCol1_MemberItems": "sCol1",
"sCol2_MemberItems": "sCol2",
"sCol3_MemberItems": "sCol3",
"sCol4_MemberItems": "sCol4",
"sCol5_MemberItems": "sCol5",
"sCol6_MemberItems": "sCol6",
"sCol7_MemberItems": "sCol7",
"sCol8_MemberItems": "sCol8",
"sCol9_MemberItems": "sCol9",
"sCol10_MemberItems": "sCol10",
"CouponID_CouponMember": "DF8CA626-7BCF-489C-9C6D-85B58B2D6D5D", // smae couponid
"MemberID_CouponMember": "aaa", // same memberid
"sCol1_CouponMember": "sCol1",
"sCol2_CouponMember": "sCol2",
"sCol3_CouponMember": "sCol3",
"sCol4_CouponMember": "sCol4",
"sCol5_CouponMember": "sCol5",
"sCol6_CouponMember": "sCol6",
"sCol7_CouponMember": "sCol7",
"sCol8_CouponMember": "sCol8",
"sCol9_CouponMember": "sCol9",
"sCol10_CouponMember": "sCol10"
}
Issue, Closed
from cloudbread.
Related Issues (20)
- Show detail SQL error message by code HOT 2
- Do not use unique constratin on email, members table - because, 3rd party auth does need email HOT 1
- API for external game related marketing service HOT 2
- Request of CBInsPurchase HOT 4
- non-default value Coupon table - UpdatedAt column HOT 2
- CBComSelCoupon API is not implemented as API HOT 2
- update CloudBread-DB-Install-Script Readme file HOT 1
- encrypt request and response HOT 1
- CBRank - change sid to nickname HOT 3
- Make database - rank
- adding KAKAO authentication
- add swagger feature HOT 1
- cloudbread user mode log leaving HOT 2
- uspComUdtMember procedure condition check member pwd HOT 1
- cloudbread unity sdk generate error HOT 2
- building new documentation repository - deplicated wiki project HOT 1
- bug : No connection is available to service this operation: ZREVRANK cbrank HOT 1
- Need of English installation guide
- CBToolEditor.cs GetClassTextFile function error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cloudbread.