Commit 24dae774 authored by Davve's avatar Davve

增加pick

parent bd7378a8
......@@ -4,6 +4,7 @@
# Date: 2018/11/15
from utils.base import APIView
from alpha_types.venus import PICK_TYPE
class PickListView(APIView):
......@@ -63,4 +64,37 @@ class UpdateOrCreateView(APIView):
raise e
return {
'message': '操作成功'
}
class PickUserListView(APIView):
def get(self, request):
pick_id = request.GET.get('id', 0)
pick_type = int(request.GET.get('pick_type', 0))
offset = int(request.GET.get('page', 1))
limit = int(request.GET.get('limit', 10))
filters = {
'pick_id': pick_id
}
dispatch_rpc_endpoint = {
PICK_TYPE.CELEBRITY: 'venus/sun/pick/celebrity/list',
PICK_TYPE.TOPIC: 'venus/sun/pick/topic/list'
}
try:
data = self.rpc[dispatch_rpc_endpoint[pick_type]](offset=(offset - 1) * limit, limit=limit, filters=filters).unwrap()
except Exception as e:
raise e
return data
def post(self, request):
celebrity_id = request.POST.get('celebrity_id', '')
fake_pick_nums = request.POST.get('fake_pick_nums', 0)
topic_id = request.POST.get('topic_id', '')
try:
self.rpc['venus/sun/pick/add_fake_pick_nums'](celebrity_id=celebrity_id, topic_id=topic_id, pick_nums=fake_pick_nums).unwrap()
except Exception as e:
raise e
return {
'message': '操作失败'
}
\ No newline at end of file
......@@ -17,7 +17,7 @@ class GroupSearchView(APIView):
return {'data': data}
class RegionSearchView(APIView):
class CountrySearchView(APIView):
def get(self, request):
name = request.GET.get('name')
try:
......
......@@ -7,23 +7,23 @@ import json
from utils.base import APIView
class StarListView(APIView):
class CelebrityListView(APIView):
def get(self, request):
page = int(request.GET.get('page', 0))
limit = int(request.GET.get('limit', 10))
filter = self.handle_filter(request.GET.get('filter', ""))
try:
data = self.rpc['venus/sun/star/list'](offset=(page-1)*limit, limit=limit, filters=filter).unwrap()
data = self.rpc['venus/sun/celebrity/list'](offset=(page-1)*limit, limit=limit, filters=filter).unwrap()
except Exception as e:
raise e
return data
class StarUpdateOrCreate(APIView):
class CelebrityUpdateOrCreate(APIView):
def get(self, request):
id = request.GET.get('id')
try:
data = self.rpc['venus/sun/star/get'](id=id).unwrap()
data = self.rpc['venus/sun/celebrity/get'](id=id).unwrap()
except Exception as e:
raise e
return {'data': data}
......@@ -41,7 +41,7 @@ class StarUpdateOrCreate(APIView):
}
print(json.loads(request.POST.get('group_ids', [])))
try:
self.rpc['venus/sun/star/edit'](id=id, data=data).unwrap()
self.rpc['venus/sun/celebrity/edit'](id=id, data=data).unwrap()
except Exception as e:
raise e
......@@ -50,7 +50,7 @@ class StarUpdateOrCreate(APIView):
}
class StarRelatedGroup(APIView):
class CelebrityRelatedGroup(APIView):
def get(self, request):
id = request.GET.get('id')
offset = int(request.GET.get('page', 0))
......
......@@ -51,33 +51,35 @@ urlpatterns = [
url(r'^topic/reply/create$', ReplyCreate.as_view()),
# star相关
url(r'^star/list$', StarListView.as_view()),
url(r'^star/create$', StarUpdateOrCreate.as_view()),
url(r'^star/detail$', StarUpdateOrCreate.as_view()),
url(r'^star/star_related_group_info', StarRelatedGroup.as_view()),
url(r'^celebrity/list$', CelebrityListView.as_view()),
url(r'^celebrity/create$', CelebrityUpdateOrCreate.as_view()),
url(r'^celebrity/detail$', CelebrityUpdateOrCreate.as_view()),
url(r'^celebrity/celebrity_related_group_info', CelebrityRelatedGroup.as_view()),
# push相关
url(r'push/list$', PushListView.as_view()),
url(r'push/create', PushUpdateOrCreateView.as_view()),
url(r'push/detail', PushUpdateOrCreateView.as_view()),
url(r'push/effect_push', EffectPushTaskView.as_view()),
url(r'^push/list$', PushListView.as_view()),
url(r'^push/create', PushUpdateOrCreateView.as_view()),
url(r'^push/detail', PushUpdateOrCreateView.as_view()),
url(r'^push/effect_push', EffectPushTaskView.as_view()),
# pick相关
url(r'pick/list$', PickListView.as_view()),
url(r'pick/list/update$', PickListView.as_view()),
url(r'pick/create$', UpdateOrCreateView.as_view()),
url(r'pick/detail/', UpdateOrCreateView.as_view()),
url(r'^pick/list$', PickListView.as_view()),
url(r'^pick/list/update$', PickListView.as_view()),
url(r'^pick/create$', UpdateOrCreateView.as_view()),
url(r'^pick/detail/', UpdateOrCreateView.as_view()),
url(r'^pick/user/list$', PickUserListView.as_view()),
url(r'^pick/add_fake_pick_nums$', PickUserListView.as_view()),
# 标签相关
url(r'tag/list$', TagListView.as_view()),
url(r'tag/list/update$', TagListView.as_view()),
url(r'tag/create', TagUpdateOrCreateView.as_view()),
url(r'tag/detail', TagUpdateOrCreateView.as_view()),
url(r'^tag/list$', TagListView.as_view()),
url(r'^tag/list/update$', TagListView.as_view()),
url(r'^tag/create$', TagUpdateOrCreateView.as_view()),
url(r'^tag/detail$', TagUpdateOrCreateView.as_view()),
]
search_urlpatterns = [
url(r'search/group$', GroupSearchView.as_view()),
url(r'search/region', RegionSearchView.as_view()),
url(r'search/country', CountrySearchView.as_view()),
url(r'search/user', UserSearchView.as_view()),
url(r'search/tag', TagSearchView.as_view()),
url(r'search/star', StarSearchView.as_view()),
......
......@@ -35,7 +35,7 @@ class UserUpdateOrCreate(APIView):
def post(self, request):
user_id = request.POST.get('id', '')
show_time = analysis_time(request.POST.get('show_time', 0))
# show_time = analysis_time(request.POST.get('show_time', 0))
tag_ids = list(set(request.POST.get('tag_ids').split(',')))
if not user_id:
user_id = time.time()
......@@ -47,7 +47,7 @@ class UserUpdateOrCreate(APIView):
'tag_ids': list(filter(lambda x: x, tag_ids)),
'is_puppet': request.POST.get('is_puppet'),
'city_id': request.POST.get('city'),
'show_time': show_time,
# 'show_time': show_time,
'phone': request.POST.get('phone'),
'email': request.POST.get('email'),
'gender': request.POST.get('gender'),
......
......@@ -10,4 +10,5 @@ git+ssh://git@git.wanmeizhensuo.com/backend/gm-protocol.git@master
git+ssh://git@git.wanmeizhensuo.com/backend/gm-config.git@v0.1.3
git+ssh://git@git.wanmeizhensuo.com/backend/gm-logging.git@v0.7.8
git+ssh://git@git.wanmeizhensuo.com/backend/gm-dataquery.git@v0.2.10
git+ssh://git@git.wanmeizhensuo.com/system/gm-tracer.git@v0.1.2
\ No newline at end of file
git+ssh://git@git.wanmeizhensuo.com/system/gm-tracer.git@v0.1.2
git+ssh://git@git.wanmeizhensuo.com/alpha/alpha-types.git@dev
\ No newline at end of file
......@@ -32,3 +32,19 @@ export function fetchPickDetail(id) {
params: { id }
})
}
export function fetchPickUserList(query) {
return request({
url: '/api/pick/user/list',
method: 'get',
params: query
})
}
export function AddFakePickNums(data) {
return request({
url: '/api/pick/add_fake_pick_nums',
method: 'post',
data
})
}
......@@ -16,9 +16,9 @@ export function groupSearch(name) {
})
}
export function regionSearch(name) {
export function countrySearch(name) {
return request({
url: '/api/search/region',
url: '/api/search/country',
method: 'get',
params: { name }
})
......
......@@ -2,7 +2,7 @@ import request from '@/utils/request'
export function fetchList(query) {
return request({
url: '/api/star/list',
url: '/api/celebrity/list',
method: 'get',
params: query
})
......@@ -10,7 +10,7 @@ export function fetchList(query) {
export function starCreate(data) {
return request({
url: '/api/star/create',
url: '/api/celebrity/create',
method: 'post',
data
})
......@@ -18,7 +18,7 @@ export function starCreate(data) {
export function starDetail(id) {
return request({
url: '/api/star/detail',
url: '/api/celebrity/detail',
method: 'get',
params: { id }
})
......@@ -26,7 +26,7 @@ export function starDetail(id) {
export function OffLineOrOnLine(data) {
return request({
url: '/api/star/update_or_create',
url: '/api/celebrity/update_or_create',
method: 'post',
data
})
......@@ -34,7 +34,7 @@ export function OffLineOrOnLine(data) {
export function fetchStarRelatedGroup(id) {
return request({
url: '/api/star/star_related_group_info',
url: '/api/celebrity/celebrity_related_group_info',
method: 'get',
params: { id }
})
......
......@@ -88,6 +88,7 @@
<span v-show="contentShortLength" class="word-counter">{{ contentShortLength }}</span>
</el-form-item>
</el-card>
</el-row>
......
This diff is collapsed.
......@@ -128,7 +128,7 @@ export default {
userListOptions: [],
expireTimeOption: {
disabledDate(date){
return date.getTime() <= Date.now();
return date.getTime() <= Date.now() ;
}
},
rules: {
......
......@@ -79,6 +79,7 @@ export default {
},
SearchTypeOptions:[
{'key': 'id', 'display_name': '推送ID'},
{'key': 'title', 'display_name': '推送标题'},
{'key': 'content', 'display_name': '推送内容'},
]
}
......
......@@ -182,7 +182,7 @@
id: '',
gender: '',
city: '',
is_online: undefined,
is_online: 0,
description: '',
avatar: '',
}
......
......@@ -166,7 +166,7 @@ export default {
this.getList()
},
handleCreate() {
this.$router.push('/pick/create')
this.$router.push('/star/create')
}
}
}
......
......@@ -301,14 +301,14 @@
posting_time: '',
content: '',
topic_ids: [],
content_level: '',
content_level: 0,
group_name: '',
reported_time: '',
user_name: '',
star_name: '',
is_puppet: '',
tag_ids: [],
is_online: '',
is_online: 0,
}
export default {
......@@ -377,6 +377,7 @@
tempRoute: {},
TopicLevelOptions: [
{'key': 0, 'display_name': '未审核'},
{'key': 1, 'display_name': '1星'},
{'key': 2, 'display_name': '2星'},
{'key': 3, 'display_name': '3星'},
......@@ -728,7 +729,7 @@
this.listQuery.limit = val
this.getList()
},
handleCurrentChange(val) {
handleCurrentChange(val) {
this.listQuery.page = val
this.getList()
},
......
......@@ -148,6 +148,7 @@ export default {
{'key': 'content', 'display_name': '帖子内容'},
],
ContentLevelTypeOptions:[
{'key': 0, 'display_name': '未审核'},
{'key': 1, 'display_name': '星级一'},
{'key': 2, 'display_name': '星级二'},
{'key': 3, 'display_name': '星级三'},
......
......@@ -49,12 +49,12 @@
<el-input v-model="postForm.nick_name" type="text" style="width: 230px"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label-width="75px" label="展示时间:" class="postInfo-container-item">
<el-date-picker v-model="postForm.show_time " type="datetime" format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期时间" :picker-options="expireTimeOption" style="width: 230px"/>
</el-form-item>
</el-col>
<!--<el-col :span="12">-->
<!--<el-form-item label-width="75px" label="展示时间:" class="postInfo-container-item">-->
<!--<el-date-picker v-model="postForm.show_time " type="datetime" format="yyyy-MM-dd HH:mm:ss"-->
<!--placeholder="选择日期时间" :picker-options="expireTimeOption" style="width: 230px"/>-->
<!--</el-form-item>-->
<!--</el-col>-->
</el-row>
<el-row>
<el-col :span="12">
......@@ -202,7 +202,7 @@
import {validateURL} from '@/utils/validate'
import {UserDetail, fetchGroupUser, userCreate} from '@/api/user'
import { GroupDetail } from '@/api/group'
import {regionSearch, tagSearch, groupSearch, citySearch} from '@/api/remoteSearch'
import { tagSearch, groupSearch, citySearch} from '@/api/remoteSearch'
import { isInArray, removeByvale} from "@/utils";
function Assembledata(target, source) {
......@@ -280,11 +280,11 @@
content: [{validator: validateRequire}],
source_uri: [{validator: validateSourceUri, trigger: 'blur'}]
},
expireTimeOption: {
disabledDate(date){
return date.getTime() <= Date.now();
}
},
// expireTimeOption: {
// disabledDate(date){
// return date.getTime() <= Date.now();
// }
// },
tempRoute: {},
listQuery: {
page: 1,
......
......@@ -223,7 +223,7 @@
this.getList()
},
handleCreate() {
this.$router.push('/pick/create')
this.$router.push('/user/create')
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment