Merge pull request #25 from henrydays/zmiguel

Zmiguel
This commit is contained in:
Henrique Dias 2019-03-10 21:13:46 +00:00 committed by GitHub
commit d305f550a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
52 changed files with 399 additions and 1924 deletions

View File

@ -23,8 +23,7 @@ import Scan from './screens/Scan'
import Calendar from './screens/Calendar'
import Home from './screens/Home'
import febrada from './screens/febrada'
import compras from './screens/compras'
/*Icons*/
@ -184,12 +183,6 @@ const Stack = createStackNavigator({
},
calendarDetail:{
screen:calendarDetail
},
febrada:{
screen:febrada
},
compras:{
screen: compras
}

View File

@ -162,8 +162,7 @@ _update=()=>{
</View>
</ImageBackground>
<TouchableOpacity onPress={() => this.props.navigation.navigate('compras')}>
<View style={styles.userStats}>
<Text style={styles.userStatsTitle}>O meu saldo:</Text>
@ -182,7 +181,7 @@ _update=()=>{
</View>
</View>
</View>
</TouchableOpacity>

View File

@ -1,102 +0,0 @@
import * as React from 'react';
import {View, StyleSheet, Dimensions, Image, ScrollView, Text, Button, TouchableOpacity, Animated} from 'react-native';
import {TabView, TabBar, SceneMap} from 'react-native-tab-view';
import {
RkButton, RkCard, RkText,
RkTheme
} from 'react-native-ui-kitten';
import Timeline from 'react-native-timeline-feed'
import * as Progress from 'react-native-progress';
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import * as Actions from '../store/actions'; //Import your actionss
import { Slider } from 'react-native-elements';
function round(value, decimals) {
return Number(Math.round(value+'e'+decimals)+'e-'+decimals);
}
const SCREEN_HEIGHT = Dimensions.get("window").height;
const SCREEN_WIDTH = Dimensions.get("window").width;
class compras extends React.Component {
state = {
index: 0,
value:0
};
componentDidMount() {
this.props.getEvents(this.props.user);
console.log('didMount');
console.log(this.props.events);
}
constructor() {
super()
}
render() {
return (
<View style={{flex:1}}>
<View style={{ flex: 1, alignItems: 'stretch', justifyContent: 'center' ,width:SCREEN_WIDTH*0.7}}>
<Slider
maximumValue={20}
minimumValue={2}
value={this.state.value}
onValueChange={value => this.setState({ value })}
/>
<Text>Finos: {Math.round(this.state.value)}</Text>
</View>
<Text>Preço Unitário : { round(0.598 + 0.63 * Math.pow(Math.E ,(-0.221* this.state.value)),2)}</Text>
<Text>Preço total: {round((0.598 + 0.63 * Math.pow(Math.E ,(-0.221* this.state.value)))* this.state.value,2)}</Text>
<Button
title="PAGAR COM MBWAY"
onPress={() => this.props.navigation.navigate('febrada')}
/>
</View>
);
}
}
const styles = StyleSheet.create({
});
function mapStateToProps(state, props) {
return {
token: state.apiReducer.token,
user: state.apiReducer.user,
logged: state.apiReducer.logged,
events: state.apiReducer.events,
userDetails: state.apiReducer.userDetails,
}
}
function mapDispatchToProps(dispatch) {
return bindActionCreators(Actions, dispatch);
}
export default connect(mapStateToProps, mapDispatchToProps)(compras);

View File

@ -1,92 +0,0 @@
import * as React from 'react';
import {View, StyleSheet, Dimensions, Image, ScrollView, Text, Button, TouchableOpacity, Animated} from 'react-native';
import {TabView, TabBar, SceneMap} from 'react-native-tab-view';
import {
RkButton, RkCard, RkText,
RkTheme
} from 'react-native-ui-kitten';
import Timeline from 'react-native-timeline-feed'
import * as Progress from 'react-native-progress';
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import * as Actions from '../store/actions'; //Import your actionss
import { Slider } from 'react-native-elements';
const SCREEN_HEIGHT = Dimensions.get("window").height;
const SCREEN_WIDTH = Dimensions.get("window").width;
class febrada extends React.Component {
state = {
index: 0,
};
componentDidMount() {
this.props.getEvents(this.props.user);
console.log('didMount');
console.log(this.props.events);
}
constructor() {
super()
}
render() {
return (
<View style={{flex:1}}>
<View style={{ flex: 1, alignItems: 'stretch', justifyContent: 'center' ,width:SCREEN_WIDTH*0.7}}>
<Slider
maximumValue={50}
minimumValue={2}
value={this.state.value}
onValueChange={value => this.setState({ value })}
/>
<Text>Value: {Math.round(this.state.value)}</Text>
</View></View>
);
}
}
const styles = StyleSheet.create({
});
function mapStateToProps(state, props) {
return {
token: state.apiReducer.token,
user: state.apiReducer.user,
logged: state.apiReducer.logged,
events: state.apiReducer.events,
userDetails: state.apiReducer.userDetails,
}
}
function mapDispatchToProps(dispatch) {
return bindActionCreators(Actions, dispatch);
}
export default connect(mapStateToProps, mapDispatchToProps)(febrada);

View File

@ -17,8 +17,7 @@ export const CHANGE_GUEST = 'CHANGE_GUEST'
export const GET_SESSIONS= 'GET_SESSIONS'
export const SIGN_SESSION= 'SIGN_SESSION'
export const WAIT_CHANGE='WAIT_CHANGE'
export const SESSION_BLOCKS='SESSION_BLOCKS'
export const TIMERWAIT_CHANGE='TIMERWAIT_CHANGE'
//UI

View File

@ -444,10 +444,11 @@ var i=0
const result = flow(
groupBy("day")
)(events);
var cenas=[];
for (let key in result) {
cenas.push(result[key]);
@ -471,6 +472,9 @@ var i=0
day: cenas[0][key].day
});
}
for (let key in cenas[1]) {
b.push({
time:cenas[1][key].time ,
@ -508,6 +512,10 @@ var i=0
day: cenas[3][key].day
});
}
a=_.sortBy(a, function(o) { return o.time; });
b=_.sortBy(b, function(o) { return o.time; });
c=_.sortBy(c, function(o) { return o.time; });
d=_.sortBy(d, function(o) { return o.time; });
dispatch({
type: GET_EVENTS,

View File

@ -5,7 +5,6 @@
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; };
00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; };
@ -36,7 +35,6 @@
2D16E6881FA4F8E400B85C8A /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2D16E6891FA4F8E400B85C8A /* libReact.a */; };
2DCD954D1E0B4F2C00145EB5 /* appTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* appTests.m */; };
2DF0FFEE2056DD460020B375 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3EA31DF850E9000B6D8A /* libReact.a */; };
4EBB88037B054A508BF35245 /* libRNDeviceInfo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0F42241E0235464C91B24049 /* libRNDeviceInfo.a */; };
514DB1DF2E3B452F9EF272E3 /* libRNVectorIcons-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 95B0A42B6CD8441E904E6EB9 /* libRNVectorIcons-tvOS.a */; };
69E1B84AE0DF486CB1B1D226 /* libBVLinearGradient.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C00CE8A4E3B747F9816B91CF /* libBVLinearGradient.a */; };
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
@ -60,6 +58,7 @@
BE5EAB86221B7D5400E92E5B /* Zocial.ttf in Resources */ = {isa = PBXBuildFile; fileRef = BE5EAB77221B7D5400E92E5B /* Zocial.ttf */; };
BE5EAC3A221B83CF00E92E5B /* Ionicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = BE302B75221B7C3B005626CF /* Ionicons.ttf */; };
BE5EAC41221B889900E92E5B /* libReactNativePermissions.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BE5EAC40221B888C00E92E5B /* libReactNativePermissions.a */; };
4EBB88037B054A508BF35245 /* libRNDeviceInfo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0F42241E0235464C91B24049 /* libRNDeviceInfo.a */; };
E677346A94D54E90817979B0 /* libRNDeviceInfo-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3C4D43A092A4408B91B32E76 /* libRNDeviceInfo-tvOS.a */; };
/* End PBXBuildFile section */
@ -337,20 +336,6 @@
remoteGlobalIDString = 358F4ED71D1E81A9004DF814;
remoteInfo = RCTBlob;
};
BE05D7E2222EFEA100EC8AFD /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 5BA133418E6F4967BC5BC234 /* RNDeviceInfo.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = DA5891D81BA9A9FC002B4DB2;
remoteInfo = RNDeviceInfo;
};
BE05D7E4222EFEA100EC8AFD /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 5BA133418E6F4967BC5BC234 /* RNDeviceInfo.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = E72EC1401F7ABB5A0001BC90;
remoteInfo = "RNDeviceInfo-tvOS";
};
BE302B6B221B7860005626CF /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = BE302B67221B7860005626CF /* RNCamera.xcodeproj */;
@ -412,7 +397,6 @@
00E356EE1AD99517003FC87E /* appTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = appTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
00E356F21AD99517003FC87E /* appTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = appTests.m; sourceTree = "<group>"; };
0F42241E0235464C91B24049 /* libRNDeviceInfo.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNDeviceInfo.a; sourceTree = "<group>"; };
139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = "<group>"; };
139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = "<group>"; };
13B07F961A680F5B00A75B9A /* app.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = app.app; sourceTree = BUILT_PRODUCTS_DIR; };
@ -427,8 +411,6 @@
2D02E47B1E0B4A5D006451C7 /* app-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "app-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
2D02E4901E0B4A5D006451C7 /* app-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "app-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
2D16E6891FA4F8E400B85C8A /* libReact.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libReact.a; sourceTree = BUILT_PRODUCTS_DIR; };
3C4D43A092A4408B91B32E76 /* libRNDeviceInfo-tvOS.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = "libRNDeviceInfo-tvOS.a"; sourceTree = "<group>"; };
5BA133418E6F4967BC5BC234 /* RNDeviceInfo.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNDeviceInfo.xcodeproj; path = "../node_modules/react-native-device-info/ios/RNDeviceInfo.xcodeproj"; sourceTree = "<group>"; };
5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = "<group>"; };
664970B9D10A41A18B44727F /* RNVectorIcons.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNVectorIcons.xcodeproj; path = "../node_modules/react-native-vector-icons/RNVectorIcons.xcodeproj"; sourceTree = "<group>"; };
78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = "<group>"; };
@ -455,6 +437,9 @@
BE5EAC3B221B888C00E92E5B /* ReactNativePermissions.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactNativePermissions.xcodeproj; path = "../node_modules/react-native-permissions/ios/ReactNativePermissions.xcodeproj"; sourceTree = "<group>"; };
C00CE8A4E3B747F9816B91CF /* libBVLinearGradient.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libBVLinearGradient.a; sourceTree = "<group>"; };
EB0A5A258CBE4EEFAD3C358E /* libRNVectorIcons.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNVectorIcons.a; sourceTree = "<group>"; };
5BA133418E6F4967BC5BC234 /* RNDeviceInfo.xcodeproj */ = {isa = PBXFileReference; name = "RNDeviceInfo.xcodeproj"; path = "../node_modules/react-native-device-info/ios/RNDeviceInfo.xcodeproj"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
0F42241E0235464C91B24049 /* libRNDeviceInfo.a */ = {isa = PBXFileReference; name = "libRNDeviceInfo.a"; path = "libRNDeviceInfo.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
3C4D43A092A4408B91B32E76 /* libRNDeviceInfo-tvOS.a */ = {isa = PBXFileReference; name = "libRNDeviceInfo-tvOS.a"; path = "libRNDeviceInfo-tvOS.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -731,15 +716,6 @@
name = Products;
sourceTree = "<group>";
};
BE05D7DE222EFEA000EC8AFD /* Products */ = {
isa = PBXGroup;
children = (
BE05D7E3222EFEA100EC8AFD /* libRNDeviceInfo.a */,
BE05D7E5222EFEA100EC8AFD /* libRNDeviceInfo-tvOS.a */,
);
name = Products;
sourceTree = "<group>";
};
BE302B68221B7860005626CF /* Products */ = {
isa = PBXGroup;
children = (
@ -784,8 +760,6 @@
EB0A5A258CBE4EEFAD3C358E /* libRNVectorIcons.a */,
95B0A42B6CD8441E904E6EB9 /* libRNVectorIcons-tvOS.a */,
C00CE8A4E3B747F9816B91CF /* libBVLinearGradient.a */,
0F42241E0235464C91B24049 /* libRNDeviceInfo.a */,
3C4D43A092A4408B91B32E76 /* libRNDeviceInfo-tvOS.a */,
);
name = "Recovered References";
sourceTree = "<group>";
@ -902,7 +876,6 @@
TargetAttributes = {
00E356ED1AD99517003FC87E = {
CreatedOnToolsVersion = 6.2;
DevelopmentTeam = HLA62A6826;
TestTargetID = 13B07F861A680F5B00A75B9A;
};
13B07F861A680F5B00A75B9A = {
@ -991,10 +964,6 @@
ProductGroup = BE302B68221B7860005626CF /* Products */;
ProjectRef = BE302B67221B7860005626CF /* RNCamera.xcodeproj */;
},
{
ProductGroup = BE05D7DE222EFEA000EC8AFD /* Products */;
ProjectRef = 5BA133418E6F4967BC5BC234 /* RNDeviceInfo.xcodeproj */;
},
{
ProductGroup = BE302B6F221B7AC7005626CF /* Products */;
ProjectRef = BE302B6E221B7AC7005626CF /* RNGestureHandler.xcodeproj */;
@ -1274,20 +1243,6 @@
remoteRef = ADBDB9261DFEBF0700ED6528 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
BE05D7E3222EFEA100EC8AFD /* libRNDeviceInfo.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libRNDeviceInfo.a;
remoteRef = BE05D7E2222EFEA100EC8AFD /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
BE05D7E5222EFEA100EC8AFD /* libRNDeviceInfo-tvOS.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = "libRNDeviceInfo-tvOS.a";
remoteRef = BE05D7E4222EFEA100EC8AFD /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
BE302B6C221B7860005626CF /* libRNCamera.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
@ -1486,7 +1441,6 @@
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
DEVELOPMENT_TEAM = HLA62A6826;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
@ -1523,7 +1477,6 @@
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
COPY_PHASE_STRIP = NO;
DEVELOPMENT_TEAM = HLA62A6826;
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager",

View File

@ -10,7 +10,6 @@
"@redux-offline/redux-offline": "^2.5.1",
"axios": "^0.18.0",
"expo": "^32.0.5",
"lodash": "^4.17.11",
"material-icons-react": "^1.0.4",
"moment": "^2.24.0",
"prop-types": "^15.6.2",

View File

@ -57,5 +57,22 @@ namespace api.Controllers
var Teams = await _repo.GetEventLocEvent(id);
return Ok(Teams);
}
// POST api/eventLocs/add
// add new event
[HttpPost("add")]
public async Task<IActionResult> AddEventLoc(EventLocAdd EventLocData)
{
EventLoc EAdd = new EventLoc{EventId = EventLocData.EventId, Lat = EventLocData.Lat, Long = EventLocData.Long, Nome = EventLocData.Nome, Desc = EventLocData.Desc, Img = EventLocData.Img};
await context.EventLocs.AddAsync(EAdd);
var result = context.SaveChanges();
if (result == 1)
{
return StatusCode(201);
}
return BadRequest();
}
}
}

View File

@ -60,5 +60,37 @@ namespace api.Controllers
return Ok(Locs);
}
// POST api/eventLocsVisited/add
// add new event
[HttpPost("add")]
public async Task<IActionResult> AddEventLoc(EventLocVisitedAdd EventLocVisitedData)
{
EventLoc Loc = await context.EventLocs.FirstOrDefaultAsync(a=>a.Id == EventLocVisitedData.EventLocID);
var userT = await context.Users.FirstOrDefaultAsync(u=>u.QRcode==EventLocVisitedData.USerQR);
if(userT.team == null){
return StatusCode(403);
}
Team TeamToEdit = userT.team;
TeamToEdit.Pontos += EventLocVisitedData.pontos;
EventLocVisited toAdd = new EventLocVisited{Team = TeamToEdit,Location = Loc, timestamp = DateTime.Now};
await context.EventLocsVisited.AddAsync(toAdd);
context.Teams.Update(TeamToEdit);
var result = context.SaveChanges();
if (result >= 1)
{
return StatusCode(201);
}
return BadRequest();
}
}
}

View File

@ -46,5 +46,22 @@ namespace api.Controllers
var Event = await _repo.GetEvent(id);
return Ok(Event);
}
// POST api/events/add
// add new event
[HttpPost("add")]
public async Task<IActionResult> AddEvent(EventForAdd EventData)
{
Event EAdd = new Event{Nome = EventData.Nome,Desc = EventData.Desc};
await context.Events.AddAsync(EAdd);
var result = context.SaveChanges();
if (result == 1)
{
return StatusCode(201);
}
return BadRequest();
}
}
}

View File

@ -67,22 +67,25 @@ namespace api.Controllers
{
User tCap = await context.Users.FirstOrDefaultAsync(u=>u.QRcode == TeamAddDetails.capQR);
List<User> memb = new List<User>();
memb.Add(tCap);
Team tAdd = new Team{EventId = TeamAddDetails.EventId, Nome = TeamAddDetails.Nome, Cap = tCap, Membros = memb, NMembros = 1, Pontos = 0};
await context.Teams.AddAsync(tAdd);
var result = context.SaveChanges();
if (result == 1)
{
return StatusCode(201);
}
return BadRequest();
if(tCap.team == null){
Team tAdd = new Team{EventId = TeamAddDetails.EventId, Nome = TeamAddDetails.Nome, Cap = tCap, NMembros = 1, Pontos = 0};
tCap.team = tAdd;
await context.Teams.AddAsync(tAdd);
context.Users.Update(tCap);
var result = context.SaveChanges();
if (result >= 1)
{
return StatusCode(201);
}
return BadRequest();
}else{
return BadRequest();
}
}
@ -94,17 +97,96 @@ namespace api.Controllers
User newMember = await context.Users.FirstOrDefaultAsync(u=>u.QRcode == MemberToAdd.newQR);
Team tEdit = await context.Teams.Include(t=>t.Membros).FirstOrDefaultAsync(t=>t.Id == MemberToAdd.id);
Team tEdit = await context.Teams.FirstOrDefaultAsync(t=>t.Id == MemberToAdd.id);
tEdit.NMembros++;
tEdit.Membros.Add(newMember);
if(newMember.team == null){
tEdit.NMembros++;
newMember.team = tEdit;
context.Update(tEdit);
context.Teams.Update(tEdit);
context.Users.Update(newMember);
var result = context.SaveChanges();
return StatusCode(201);
}else{
return StatusCode(403);
}
}
// POST api/teams/ChangeName
// create team
[HttpPost("changename")]
public async Task<IActionResult> ChangeName(TeamChangeName NameChange)
{
Team tEdit = await context.Teams.Include(t=>t.Cap).FirstOrDefaultAsync(t=>t.Id == NameChange.TeamID);
User cap = await context.Users.FirstOrDefaultAsync(u=>u.QRcode == NameChange.UserQR);
if(cap == tEdit.Cap){
tEdit.Nome = NameChange.nome;
}
context.Teams.Update(tEdit);
var result = context.SaveChanges();
return StatusCode(201);
}
// POST api/teams/delete
// create team
[HttpPost("delete")]
public async Task<IActionResult> DeleteTeam(TeamDelete DeleteData)
{
Team tEdit = await context.Teams.Include(t=>t.Cap).FirstOrDefaultAsync(t=>t.Id == DeleteData.TeamID);
User cap = await context.Users.FirstOrDefaultAsync(u=>u.QRcode == DeleteData.UserQR);
if(cap == tEdit.Cap){
context.Teams.Remove(tEdit);
cap.team = null;
context.Users.Update(cap);
var result = context.SaveChanges();
return StatusCode(201);
}else{
return StatusCode(403);
}
}
// POST api/teams/remove/member
// remove member
[HttpPost("remove/member")]
public async Task<IActionResult> RemoveTeamMember(TeamRemoveMEmber MemberToRemove)
{
User rmMember = await context.Users.FirstOrDefaultAsync(u=>u.QRcode == MemberToRemove.UserToRemoveQR);
Team tEdit = await context.Teams.Include(t=>t.Cap).FirstOrDefaultAsync(t=>t.Id == MemberToRemove.TeamID);
if(rmMember == tEdit.Cap){
return StatusCode(403);
}
if(rmMember.team == tEdit){
tEdit.NMembros--;
rmMember.team = null;
context.Teams.Update(tEdit);
context.Users.Update(rmMember);
var result = context.SaveChanges();
return StatusCode(201);
}else{
return StatusCode(403);
}
}
}
}

View File

@ -23,9 +23,16 @@ namespace api.Data
return rEventLocs;
}
public async Task<EventLoc> GetEventLocEvent(int id)
public async Task<List<EventLoc>> GetEventLocEvent(int id)
{
var rEventLocs = await _context.EventLocs.FirstOrDefaultAsync(e=>e.EventId == id);
List<EventLoc> eLocs = await _context.EventLocs.ToListAsync();
List<EventLoc> rEventLocs = new List<EventLoc>();
eLocs.ForEach(delegate (EventLoc e){
if(e.EventId == id){
rEventLocs.Add(e);
}
});
return rEventLocs;
}

View File

@ -18,24 +18,33 @@ namespace api.Data
public async Task<IEnumerable<EventLocVisited>> GetEventLocsVisited()
{
var rEventLocsVisitedList = await _context.EventLocsVisited.ToListAsync();
var rEventLocsVisitedList = await _context.EventLocsVisited.Include(e=>e.Team).Include(e=>e.Location).ToListAsync();
return rEventLocsVisitedList;
}
public Task<IEnumerable<EventLocVisited>> GetEventLocsVisitedTeam(int id)
public async Task<List<EventLocVisited>> GetEventLocsVisitedTeam(int id)
{
var allLocs = _context.EventLocsVisited.ToListAsync();
allLocs.ForEach(i=>Console.Write("{0}\t", i));
Console.WriteLine("teste");
List<EventLocVisited> allLocs = await _context.EventLocsVisited.Include(e=>e.Team).Include(e=>e.Location).ToListAsync();
List<EventLocVisited> rList = new List<EventLocVisited>();
for(var i=0;i<allLocs.Count;i++){
if(allLocs[i].Team.Id == id){
rList.Add(allLocs[i]);
}
}
return allLocs;
return rList;
}
public async Task<List<EventLocVisited>> GetEventLocsVisitedEvent(int id)
{
List<EventLocVisited> allLocs = await _context.EventLocsVisited.Include(e=>e.Team).Include(e=>e.Location).ToListAsync();
List<EventLocVisited> rList = new List<EventLocVisited>();
for(var i=0;i<allLocs.Count;i++){
if(allLocs[i].Location.EventId == id){
rList.Add(allLocs[i]);
}
}
return rList;
}
}

View File

@ -9,7 +9,7 @@ namespace api.Data
Task<IEnumerable<EventLoc>> GetEventLocs();
Task<EventLoc> GetEventLoc(int id);
Task<EventLoc> GetEventLocEvent(int id);
Task<List<EventLoc>> GetEventLocEvent(int id);
}

View File

@ -10,7 +10,7 @@ namespace api.Data
Task<IEnumerable<Team>> GetTeams();
Task<List<Team>> GetEventTeam(int id);
Task<List<Team>> GetUserTeam(String QR);
Task<Team> GetUserTeam(String QR);
}

View File

@ -18,7 +18,7 @@ namespace api.Data
public async Task<List<Team>> GetEventTeam(int id)
{
List<Team> allTeams = await _context.Teams.Include(a=>a.Cap).Include(a=>a.Membros).ToListAsync();
List<Team> allTeams = await _context.Teams.Include(a=>a.Cap).ToListAsync();
List<Team> rTeam = new List<Team>();
allTeams.ForEach(delegate(Team t){
if(t.EventId == id){
@ -29,24 +29,16 @@ namespace api.Data
return rTeam;
}
public async Task<List<Team>> GetUserTeam(String QR)
public async Task<Team> GetUserTeam(String QR)
{
List<Team> allTeams = await _context.Teams.Include(a=>a.Cap).Include(a=>a.Membros).ToListAsync();
List<Team> rTeam = new List<Team>();
allTeams.ForEach(delegate(Team t){
foreach (User u in t.Membros){
if(u.QRcode == QR){
rTeam.Add(t);
}
}
});
var rTeam = (await _context.Users.FirstAsync(u=>u.QRcode == QR)).team;
return rTeam;
}
public async Task<IEnumerable<Team>> GetTeams()
{
var rTeams = await _context.Teams.Include(a=>a.Cap).Include(a=>a.Membros).ToListAsync();
var rTeams = await _context.Teams.Include(a=>a.Cap).ToListAsync();
return rTeams;
}

16
api/Dtos/EventForAdd.cs Normal file
View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using api.Models;
namespace api.Dtos
{
public class EventForAdd
{
[Required]
public string Nome{get;set;} //equipa id
[Required]
public string Desc{get;set;} //novo membro
}
}

28
api/Dtos/EventLocAdd.cs Normal file
View File

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using api.Models;
namespace api.Dtos
{
public class EventLocAdd
{
[Required]
public int EventId{get;set;} //Event ID
[Required]
public float Lat{get;set;} //latitude
[Required]
public float Long{get;set;} //longitude
[Required]
public String Nome{get;set;} //Nome da localização
[Required]
public String Desc{get;set;} //Descrição
public Photo Img{get;set;} //Foto da localização
}
}

View File

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using api.Models;
namespace api.Dtos
{
public class EventLocVisitedAdd
{
[Required]
public String USerQR{get;set;} //User ID
[Required]
public int EventLocID{get;set;} //Loc id
[Required]
public int pontos{get;set;} //Pontos a adicionar
}
}

View File

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using api.Models;
namespace api.Dtos
{
public class TeamChangeName
{
[Required]
public int TeamID{get;set;} //teamid
[Required]
public string nome{get;set;} //novo nome
[Required]
public string UserQR{get;set;} //user qr
}
}

17
api/Dtos/TeamDelete.cs Normal file
View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using api.Models;
namespace api.Dtos
{
public class TeamDelete
{
[Required]
public int TeamID{get;set;} //teamid
[Required]
public string UserQR{get;set;} //user qr
}
}

View File

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using api.Models;
namespace api.Dtos
{
public class TeamRemoveMEmber
{
[Required]
public int TeamID{get;set;} //teamid
[Required]
public string UserQR{get;set;} //user qr
[Required]
public string UserToRemoveQR{get;set;} //user qr
}
}

View File

@ -1,385 +0,0 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using api.Data;
namespace api.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20190223232738_TeamsEvents")]
partial class TeamsEvents
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.2.0-rtm-35687")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<int>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ClaimType");
b.Property<string>("ClaimValue");
b.Property<int>("RoleId");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<int>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ClaimType");
b.Property<string>("ClaimValue");
b.Property<int>("UserId");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<int>", b =>
{
b.Property<string>("LoginProvider");
b.Property<string>("ProviderKey");
b.Property<string>("ProviderDisplayName");
b.Property<int>("UserId");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<int>", b =>
{
b.Property<int>("UserId");
b.Property<string>("LoginProvider");
b.Property<string>("Name");
b.Property<string>("Value");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens");
});
modelBuilder.Entity("api.Models.Event", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Desc");
b.Property<string>("Nome");
b.HasKey("Id");
b.ToTable("Events");
});
modelBuilder.Entity("api.Models.EventLoc", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Desc");
b.Property<int>("EventId");
b.Property<int?>("ImgId");
b.Property<float>("Lat");
b.Property<float>("Long");
b.Property<string>("Nome");
b.HasKey("Id");
b.HasIndex("ImgId");
b.ToTable("EventLocs");
});
modelBuilder.Entity("api.Models.EventLocVisited", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int?>("LocationId");
b.Property<int?>("TeamId");
b.Property<DateTime>("timestamp");
b.HasKey("Id");
b.HasIndex("LocationId");
b.HasIndex("TeamId");
b.ToTable("EventLocsVisited");
});
modelBuilder.Entity("api.Models.Photo", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("DateAdded");
b.Property<string>("Description");
b.Property<bool>("IsMain");
b.Property<string>("Url");
b.Property<int>("UserId");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("Photos");
});
modelBuilder.Entity("api.Models.Role", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken();
b.Property<string>("Name")
.HasMaxLength(256);
b.Property<string>("NormalizedName")
.HasMaxLength(256);
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasName("RoleNameIndex");
b.ToTable("AspNetRoles");
});
modelBuilder.Entity("api.Models.Team", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int?>("CapId");
b.Property<int>("EventId");
b.Property<int>("NMembros");
b.Property<string>("Nome");
b.Property<int>("Pontos");
b.Property<string>("QRcode");
b.HasKey("Id");
b.HasIndex("CapId");
b.ToTable("Teams");
});
modelBuilder.Entity("api.Models.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int>("AccessFailedCount");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken();
b.Property<string>("Email")
.HasMaxLength(256);
b.Property<bool>("EmailConfirmed");
b.Property<bool>("LockoutEnabled");
b.Property<DateTimeOffset?>("LockoutEnd");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256);
b.Property<string>("NormalizedUserName")
.HasMaxLength(256);
b.Property<string>("PasswordHash");
b.Property<string>("PhoneNumber");
b.Property<bool>("PhoneNumberConfirmed");
b.Property<string>("QRcode");
b.Property<string>("SecurityStamp");
b.Property<int?>("TeamId");
b.Property<bool>("TwoFactorEnabled");
b.Property<string>("UserName")
.HasMaxLength(256);
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasName("UserNameIndex");
b.HasIndex("TeamId");
b.ToTable("AspNetUsers");
});
modelBuilder.Entity("api.Models.UserRole", b =>
{
b.Property<int>("UserId");
b.Property<int>("RoleId");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles");
});
modelBuilder.Entity("api.Models.Value", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd();
b.Property<string>("Name");
b.HasKey("id");
b.ToTable("Values");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<int>", b =>
{
b.HasOne("api.Models.Role")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<int>", b =>
{
b.HasOne("api.Models.User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<int>", b =>
{
b.HasOne("api.Models.User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<int>", b =>
{
b.HasOne("api.Models.User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("api.Models.EventLoc", b =>
{
b.HasOne("api.Models.Photo", "Img")
.WithMany()
.HasForeignKey("ImgId");
});
modelBuilder.Entity("api.Models.EventLocVisited", b =>
{
b.HasOne("api.Models.EventLoc", "Location")
.WithMany()
.HasForeignKey("LocationId");
b.HasOne("api.Models.Team", "Team")
.WithMany()
.HasForeignKey("TeamId");
});
modelBuilder.Entity("api.Models.Photo", b =>
{
b.HasOne("api.Models.User", "User")
.WithMany("Photos")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("api.Models.Team", b =>
{
b.HasOne("api.Models.User", "Cap")
.WithMany()
.HasForeignKey("CapId");
});
modelBuilder.Entity("api.Models.User", b =>
{
b.HasOne("api.Models.Team")
.WithMany("Membros")
.HasForeignKey("TeamId");
});
modelBuilder.Entity("api.Models.UserRole", b =>
{
b.HasOne("api.Models.Role", "Role")
.WithMany("UserRoles")
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("api.Models.User", "User")
.WithMany("UserRoles")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
#pragma warning restore 612, 618
}
}
}

View File

@ -1,417 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace api.Migrations
{
public partial class TeamsEvents : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AspNetRoles",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Name = table.Column<string>(maxLength: 256, nullable: true),
NormalizedName = table.Column<string>(maxLength: 256, nullable: true),
ConcurrencyStamp = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetRoles", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Events",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Nome = table.Column<string>(nullable: true),
Desc = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Events", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Values",
columns: table => new
{
id = table.Column<int>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Name = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Values", x => x.id);
});
migrationBuilder.CreateTable(
name: "AspNetRoleClaims",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
RoleId = table.Column<int>(nullable: false),
ClaimType = table.Column<string>(nullable: true),
ClaimValue = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id);
table.ForeignKey(
name: "FK_AspNetRoleClaims_AspNetRoles_RoleId",
column: x => x.RoleId,
principalTable: "AspNetRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AspNetUserRoles",
columns: table => new
{
UserId = table.Column<int>(nullable: false),
RoleId = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId });
table.ForeignKey(
name: "FK_AspNetUserRoles_AspNetRoles_RoleId",
column: x => x.RoleId,
principalTable: "AspNetRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AspNetUserClaims",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
UserId = table.Column<int>(nullable: false),
ClaimType = table.Column<string>(nullable: true),
ClaimValue = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserClaims", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AspNetUserLogins",
columns: table => new
{
LoginProvider = table.Column<string>(nullable: false),
ProviderKey = table.Column<string>(nullable: false),
ProviderDisplayName = table.Column<string>(nullable: true),
UserId = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey });
});
migrationBuilder.CreateTable(
name: "AspNetUserTokens",
columns: table => new
{
UserId = table.Column<int>(nullable: false),
LoginProvider = table.Column<string>(nullable: false),
Name = table.Column<string>(nullable: false),
Value = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name });
});
migrationBuilder.CreateTable(
name: "Photos",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Url = table.Column<string>(nullable: true),
Description = table.Column<string>(nullable: true),
DateAdded = table.Column<DateTime>(nullable: false),
IsMain = table.Column<bool>(nullable: false),
UserId = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Photos", x => x.Id);
});
migrationBuilder.CreateTable(
name: "EventLocs",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
EventId = table.Column<int>(nullable: false),
Lat = table.Column<float>(nullable: false),
Long = table.Column<float>(nullable: false),
Nome = table.Column<string>(nullable: true),
Desc = table.Column<string>(nullable: true),
ImgId = table.Column<int>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_EventLocs", x => x.Id);
table.ForeignKey(
name: "FK_EventLocs_Photos_ImgId",
column: x => x.ImgId,
principalTable: "Photos",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "Teams",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
QRcode = table.Column<string>(nullable: true),
EventId = table.Column<int>(nullable: false),
Nome = table.Column<string>(nullable: true),
CapId = table.Column<int>(nullable: true),
NMembros = table.Column<int>(nullable: false),
Pontos = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Teams", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AspNetUsers",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
UserName = table.Column<string>(maxLength: 256, nullable: true),
NormalizedUserName = table.Column<string>(maxLength: 256, nullable: true),
Email = table.Column<string>(maxLength: 256, nullable: true),
NormalizedEmail = table.Column<string>(maxLength: 256, nullable: true),
EmailConfirmed = table.Column<bool>(nullable: false),
PasswordHash = table.Column<string>(nullable: true),
SecurityStamp = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(nullable: true),
PhoneNumber = table.Column<string>(nullable: true),
PhoneNumberConfirmed = table.Column<bool>(nullable: false),
TwoFactorEnabled = table.Column<bool>(nullable: false),
LockoutEnd = table.Column<DateTimeOffset>(nullable: true),
LockoutEnabled = table.Column<bool>(nullable: false),
AccessFailedCount = table.Column<int>(nullable: false),
QRcode = table.Column<string>(nullable: true),
TeamId = table.Column<int>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUsers", x => x.Id);
table.ForeignKey(
name: "FK_AspNetUsers_Teams_TeamId",
column: x => x.TeamId,
principalTable: "Teams",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "EventLocsVisited",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
TeamId = table.Column<int>(nullable: true),
LocationId = table.Column<int>(nullable: true),
timestamp = table.Column<DateTime>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_EventLocsVisited", x => x.Id);
table.ForeignKey(
name: "FK_EventLocsVisited_EventLocs_LocationId",
column: x => x.LocationId,
principalTable: "EventLocs",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_EventLocsVisited_Teams_TeamId",
column: x => x.TeamId,
principalTable: "Teams",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_AspNetRoleClaims_RoleId",
table: "AspNetRoleClaims",
column: "RoleId");
migrationBuilder.CreateIndex(
name: "RoleNameIndex",
table: "AspNetRoles",
column: "NormalizedName",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_AspNetUserClaims_UserId",
table: "AspNetUserClaims",
column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_AspNetUserLogins_UserId",
table: "AspNetUserLogins",
column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_AspNetUserRoles_RoleId",
table: "AspNetUserRoles",
column: "RoleId");
migrationBuilder.CreateIndex(
name: "EmailIndex",
table: "AspNetUsers",
column: "NormalizedEmail");
migrationBuilder.CreateIndex(
name: "UserNameIndex",
table: "AspNetUsers",
column: "NormalizedUserName",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_AspNetUsers_TeamId",
table: "AspNetUsers",
column: "TeamId");
migrationBuilder.CreateIndex(
name: "IX_EventLocs_ImgId",
table: "EventLocs",
column: "ImgId");
migrationBuilder.CreateIndex(
name: "IX_EventLocsVisited_LocationId",
table: "EventLocsVisited",
column: "LocationId");
migrationBuilder.CreateIndex(
name: "IX_EventLocsVisited_TeamId",
table: "EventLocsVisited",
column: "TeamId");
migrationBuilder.CreateIndex(
name: "IX_Photos_UserId",
table: "Photos",
column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_Teams_CapId",
table: "Teams",
column: "CapId");
migrationBuilder.AddForeignKey(
name: "FK_AspNetUserRoles_AspNetUsers_UserId",
table: "AspNetUserRoles",
column: "UserId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_AspNetUserClaims_AspNetUsers_UserId",
table: "AspNetUserClaims",
column: "UserId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_AspNetUserLogins_AspNetUsers_UserId",
table: "AspNetUserLogins",
column: "UserId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_AspNetUserTokens_AspNetUsers_UserId",
table: "AspNetUserTokens",
column: "UserId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Photos_AspNetUsers_UserId",
table: "Photos",
column: "UserId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Teams_AspNetUsers_CapId",
table: "Teams",
column: "CapId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Teams_AspNetUsers_CapId",
table: "Teams");
migrationBuilder.DropTable(
name: "AspNetRoleClaims");
migrationBuilder.DropTable(
name: "AspNetUserClaims");
migrationBuilder.DropTable(
name: "AspNetUserLogins");
migrationBuilder.DropTable(
name: "AspNetUserRoles");
migrationBuilder.DropTable(
name: "AspNetUserTokens");
migrationBuilder.DropTable(
name: "EventLocsVisited");
migrationBuilder.DropTable(
name: "Events");
migrationBuilder.DropTable(
name: "Values");
migrationBuilder.DropTable(
name: "AspNetRoles");
migrationBuilder.DropTable(
name: "EventLocs");
migrationBuilder.DropTable(
name: "Photos");
migrationBuilder.DropTable(
name: "AspNetUsers");
migrationBuilder.DropTable(
name: "Teams");
}
}
}

View File

@ -1,452 +0,0 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using api.Data;
namespace api.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20190224020609_finos")]
partial class finos
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.2.0-rtm-35687")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<int>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ClaimType");
b.Property<string>("ClaimValue");
b.Property<int>("RoleId");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<int>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ClaimType");
b.Property<string>("ClaimValue");
b.Property<int>("UserId");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<int>", b =>
{
b.Property<string>("LoginProvider");
b.Property<string>("ProviderKey");
b.Property<string>("ProviderDisplayName");
b.Property<int>("UserId");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<int>", b =>
{
b.Property<int>("UserId");
b.Property<string>("LoginProvider");
b.Property<string>("Name");
b.Property<string>("Value");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens");
});
modelBuilder.Entity("api.Models.Event", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Desc");
b.Property<string>("Nome");
b.HasKey("Id");
b.ToTable("Events");
});
modelBuilder.Entity("api.Models.EventLoc", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Desc");
b.Property<int>("EventId");
b.Property<int?>("ImgId");
b.Property<float>("Lat");
b.Property<float>("Long");
b.Property<string>("Nome");
b.HasKey("Id");
b.HasIndex("ImgId");
b.ToTable("EventLocs");
});
modelBuilder.Entity("api.Models.EventLocVisited", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int?>("LocationId");
b.Property<int?>("TeamId");
b.Property<DateTime>("timestamp");
b.HasKey("Id");
b.HasIndex("LocationId");
b.HasIndex("TeamId");
b.ToTable("EventLocsVisited");
});
modelBuilder.Entity("api.Models.Log", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int?>("UserId");
b.Property<int?>("UserId1");
b.Property<int>("amount");
b.Property<int>("available");
b.Property<string>("logType");
b.Property<int?>("productId");
b.Property<string>("transactionId");
b.HasKey("Id");
b.HasIndex("UserId");
b.HasIndex("UserId1");
b.HasIndex("productId");
b.ToTable("Logs");
});
modelBuilder.Entity("api.Models.Photo", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("DateAdded");
b.Property<string>("Description");
b.Property<bool>("IsMain");
b.Property<string>("Url");
b.Property<int>("UserId");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("Photos");
});
modelBuilder.Entity("api.Models.Product", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int>("basePrice");
b.Property<string>("name");
b.Property<float>("revenue");
b.Property<int>("sold");
b.HasKey("Id");
b.ToTable("Products");
});
modelBuilder.Entity("api.Models.Role", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken();
b.Property<string>("Name")
.HasMaxLength(256);
b.Property<string>("NormalizedName")
.HasMaxLength(256);
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasName("RoleNameIndex");
b.ToTable("AspNetRoles");
});
modelBuilder.Entity("api.Models.Team", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int?>("CapId");
b.Property<int>("EventId");
b.Property<int>("NMembros");
b.Property<string>("Nome");
b.Property<int>("Pontos");
b.Property<string>("QRcode");
b.HasKey("Id");
b.HasIndex("CapId");
b.ToTable("Teams");
});
modelBuilder.Entity("api.Models.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int>("AccessFailedCount");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken();
b.Property<string>("Email")
.HasMaxLength(256);
b.Property<bool>("EmailConfirmed");
b.Property<bool>("LockoutEnabled");
b.Property<DateTimeOffset?>("LockoutEnd");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256);
b.Property<string>("NormalizedUserName")
.HasMaxLength(256);
b.Property<string>("PasswordHash");
b.Property<string>("PhoneNumber");
b.Property<bool>("PhoneNumberConfirmed");
b.Property<string>("QRcode");
b.Property<string>("SecurityStamp");
b.Property<int?>("TeamId");
b.Property<bool>("TwoFactorEnabled");
b.Property<string>("UserName")
.HasMaxLength(256);
b.Property<int>("drinks");
b.Property<int>("food");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasName("UserNameIndex");
b.HasIndex("TeamId");
b.ToTable("AspNetUsers");
});
modelBuilder.Entity("api.Models.UserRole", b =>
{
b.Property<int>("UserId");
b.Property<int>("RoleId");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles");
});
modelBuilder.Entity("api.Models.Value", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd();
b.Property<string>("Name");
b.HasKey("id");
b.ToTable("Values");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<int>", b =>
{
b.HasOne("api.Models.Role")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<int>", b =>
{
b.HasOne("api.Models.User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<int>", b =>
{
b.HasOne("api.Models.User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<int>", b =>
{
b.HasOne("api.Models.User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("api.Models.EventLoc", b =>
{
b.HasOne("api.Models.Photo", "Img")
.WithMany()
.HasForeignKey("ImgId");
});
modelBuilder.Entity("api.Models.EventLocVisited", b =>
{
b.HasOne("api.Models.EventLoc", "Location")
.WithMany()
.HasForeignKey("LocationId");
b.HasOne("api.Models.Team", "Team")
.WithMany()
.HasForeignKey("TeamId");
});
modelBuilder.Entity("api.Models.Log", b =>
{
b.HasOne("api.Models.User")
.WithMany("logsFebrada")
.HasForeignKey("UserId");
b.HasOne("api.Models.User")
.WithMany("logsFestarola")
.HasForeignKey("UserId1");
b.HasOne("api.Models.Product", "product")
.WithMany()
.HasForeignKey("productId");
});
modelBuilder.Entity("api.Models.Photo", b =>
{
b.HasOne("api.Models.User", "User")
.WithMany("Photos")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("api.Models.Team", b =>
{
b.HasOne("api.Models.User", "Cap")
.WithMany()
.HasForeignKey("CapId");
});
modelBuilder.Entity("api.Models.User", b =>
{
b.HasOne("api.Models.Team")
.WithMany("Membros")
.HasForeignKey("TeamId");
});
modelBuilder.Entity("api.Models.UserRole", b =>
{
b.HasOne("api.Models.Role", "Role")
.WithMany("UserRoles")
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("api.Models.User", "User")
.WithMany("UserRoles")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
#pragma warning restore 612, 618
}
}
}

View File

@ -1,22 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace api.Migrations
{
public partial class team_fix : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "QRcode",
table: "Teams");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "QRcode",
table: "Teams",
nullable: true);
}
}
}

View File

@ -9,8 +9,8 @@ using api.Data;
namespace api.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20190306210633_team_fix")]
partial class team_fix
[Migration("20190309183026_TeamsV2")]
partial class TeamsV2
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
@ -243,7 +243,7 @@ namespace api.Migrations
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int?>("CapId");
b.Property<int?>("CapID");
b.Property<int>("EventId");
@ -255,7 +255,7 @@ namespace api.Migrations
b.HasKey("Id");
b.HasIndex("CapId");
b.HasIndex("CapID");
b.ToTable("Teams");
});
@ -295,8 +295,6 @@ namespace api.Migrations
b.Property<string>("SecurityStamp");
b.Property<int?>("TeamId");
b.Property<bool>("TwoFactorEnabled");
b.Property<string>("UserName")
@ -306,6 +304,8 @@ namespace api.Migrations
b.Property<int>("food");
b.Property<int?>("teamID");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
@ -315,7 +315,7 @@ namespace api.Migrations
.IsUnique()
.HasName("UserNameIndex");
b.HasIndex("TeamId");
b.HasIndex("teamID");
b.ToTable("AspNetUsers");
});
@ -422,14 +422,14 @@ namespace api.Migrations
{
b.HasOne("api.Models.User", "Cap")
.WithMany()
.HasForeignKey("CapId");
.HasForeignKey("CapID");
});
modelBuilder.Entity("api.Models.User", b =>
{
b.HasOne("api.Models.Team")
.WithMany("Membros")
.HasForeignKey("TeamId");
b.HasOne("api.Models.Team", "team")
.WithMany()
.HasForeignKey("teamID");
});
modelBuilder.Entity("api.Models.UserRole", b =>

View File

@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
namespace api.Migrations
{
public partial class finos : Migration
public partial class TeamsV2 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
@ -220,10 +220,9 @@ namespace api.Migrations
{
Id = table.Column<int>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
QRcode = table.Column<string>(nullable: true),
EventId = table.Column<int>(nullable: false),
Nome = table.Column<string>(nullable: true),
CapId = table.Column<int>(nullable: true),
CapID = table.Column<int>(nullable: true),
NMembros = table.Column<int>(nullable: false),
Pontos = table.Column<int>(nullable: false)
},
@ -255,14 +254,14 @@ namespace api.Migrations
QRcode = table.Column<string>(nullable: true),
drinks = table.Column<int>(nullable: false),
food = table.Column<int>(nullable: false),
TeamId = table.Column<int>(nullable: true)
teamID = table.Column<int>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUsers", x => x.Id);
table.ForeignKey(
name: "FK_AspNetUsers_Teams_TeamId",
column: x => x.TeamId,
name: "FK_AspNetUsers_Teams_teamID",
column: x => x.teamID,
principalTable: "Teams",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
@ -333,9 +332,9 @@ namespace api.Migrations
unique: true);
migrationBuilder.CreateIndex(
name: "IX_AspNetUsers_TeamId",
name: "IX_AspNetUsers_teamID",
table: "AspNetUsers",
column: "TeamId");
column: "teamID");
migrationBuilder.CreateIndex(
name: "IX_EventLocs_ImgId",
@ -373,9 +372,9 @@ namespace api.Migrations
column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_Teams_CapId",
name: "IX_Teams_CapID",
table: "Teams",
column: "CapId");
column: "CapID");
migrationBuilder.AddForeignKey(
name: "FK_AspNetUserRoles_AspNetUsers_UserId",
@ -434,9 +433,9 @@ namespace api.Migrations
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Teams_AspNetUsers_CapId",
name: "FK_Teams_AspNetUsers_CapID",
table: "Teams",
column: "CapId",
column: "CapID",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
@ -445,7 +444,7 @@ namespace api.Migrations
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Teams_AspNetUsers_CapId",
name: "FK_Teams_AspNetUsers_CapID",
table: "Teams");
migrationBuilder.DropTable(

View File

@ -241,7 +241,7 @@ namespace api.Migrations
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int?>("CapId");
b.Property<int?>("CapID");
b.Property<int>("EventId");
@ -253,7 +253,7 @@ namespace api.Migrations
b.HasKey("Id");
b.HasIndex("CapId");
b.HasIndex("CapID");
b.ToTable("Teams");
});
@ -293,8 +293,6 @@ namespace api.Migrations
b.Property<string>("SecurityStamp");
b.Property<int?>("TeamId");
b.Property<bool>("TwoFactorEnabled");
b.Property<string>("UserName")
@ -304,6 +302,8 @@ namespace api.Migrations
b.Property<int>("food");
b.Property<int?>("teamID");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
@ -313,7 +313,7 @@ namespace api.Migrations
.IsUnique()
.HasName("UserNameIndex");
b.HasIndex("TeamId");
b.HasIndex("teamID");
b.ToTable("AspNetUsers");
});
@ -420,14 +420,14 @@ namespace api.Migrations
{
b.HasOne("api.Models.User", "Cap")
.WithMany()
.HasForeignKey("CapId");
.HasForeignKey("CapID");
});
modelBuilder.Entity("api.Models.User", b =>
{
b.HasOne("api.Models.Team")
.WithMany("Membros")
.HasForeignKey("TeamId");
b.HasOne("api.Models.Team", "team")
.WithMany()
.HasForeignKey("teamID");
});
modelBuilder.Entity("api.Models.UserRole", b =>

View File

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
namespace api.Models
@ -9,8 +10,9 @@ namespace api.Models
public int Id{get;set;} //id
public int EventId{get;set;} //equipa para o evento ID
public string Nome{get;set;} //Nome da equipa
[ForeignKey("CapID")]
public User Cap{get;set;} //Capitao da equipa
public List<User> Membros {get;set;} //Membros da equipa
public int NMembros {get;set;} //Numero de Membros na equipa
public int Pontos {get;set;} //Postos da equipa
}

View File

@ -1,6 +1,8 @@
using System;
using Microsoft.AspNetCore.Identity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
namespace api.Models
@ -15,7 +17,9 @@ namespace api.Models
public ICollection<Photo> Photos {get;set;}
public int drinks{get;set;}
public int food{get;set;}
[ForeignKey("teamID")]
public Team team{get;set;}
}
}

View File

@ -1,7 +0,0 @@
var http = require('http');
//create a server object:
http.createServer(function (req, res) {
res.write('Hello World!'); //write a response to the client
res.end(); //end the response
}).listen(49152); //the server object listens on port 8080

View File

@ -1,5 +1,5 @@
{
"ProjectFilePath": "/Users/henrique/ENEI2019/api/api.csproj",
"ProjectFilePath": "c:\\Users\\ZMiguel\\Desktop\\ENEI2019\\api\\api.csproj",
"TargetFramework": "netcoreapp2.1",
"TagHelpers": [],
"Configuration": {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 889 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

View File

@ -1,17 +0,0 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Generated by IcoMoon</metadata>
<defs>
<font id="icomoon" horiz-adv-x="1024">
<font-face units-per-em="1024" ascent="960" descent="-64" />
<missing-glyph horiz-adv-x="1024" />
<glyph unicode="&#x20;" horiz-adv-x="512" d="" />
<glyph unicode="&#xe900;" glyph-name="instagram" d="M941.133 960h-855.306c-47.353 0-85.827-38.474-85.827-85.827v-855.306c0-47.353 38.474-85.827 85.827-85.827h855.306c47.353 0 85.827 38.474 85.827 85.827v855.306c-2.96 47.353-41.434 85.827-85.827 85.827zM941.133 18.867h-855.306v855.306h855.306v-855.306zM517.919 143.168c-130.22 0-233.803 103.584-233.803 233.803s103.584 233.803 233.803 233.803c130.22 0 233.803-103.584 233.803-233.803s-106.543-233.803-233.803-233.803zM517.919 551.584c-97.665 0-174.613-76.948-174.613-174.613s76.948-174.613 174.613-174.613c97.665 0 174.613 76.948 174.613 174.613s-79.908 174.613-174.613 174.613zM799.075 652.208c-41.434 0-73.988 32.555-73.988 71.029 0 41.434 32.555 73.988 73.988 73.988 38.474 0 73.988-32.555 73.988-73.988 0-38.474-32.555-71.029-73.988-71.029z" />
<glyph unicode="&#xe901;" glyph-name="facebook" d="M941.133 960h-855.306c-47.353 0-85.827-38.474-85.827-85.827v-855.306c0-47.353 38.474-85.827 85.827-85.827h855.306c47.353 0 85.827 38.474 85.827 85.827v855.306c-2.96 47.353-41.434 85.827-85.827 85.827zM941.133 18.867h-855.306v855.306h855.306v-855.306zM662.936 539.746c-11.838-8.879-17.757-26.636-17.757-44.393v-44.393h121.341v-103.584h-121.341v-390.659h-145.017v390.659h-68.069v103.584h68.069v50.312c0 38.474 8.879 68.069 26.636 94.705s38.474 47.353 68.069 59.191c29.595 14.798 59.191 20.717 94.705 20.717 32.555 0 68.069-5.919 100.624-20.717l-20.717-115.422c-8.879 2.96-20.717 5.919-29.595 8.879-11.838 2.96-20.717 2.96-29.595 2.96-20.717 2.96-35.514-2.96-47.353-11.838z" />
<glyph unicode="&#xe902;" glyph-name="email" horiz-adv-x="1308" d="M1198.613 960h-1089.11c-59.191 0-109.503-38.474-109.503-85.827v-855.306c0-47.353 50.312-85.827 109.503-85.827h1089.11c59.191 0 109.503 38.474 109.503 85.827v855.306c0 47.353-50.312 85.827-109.503 85.827zM1198.613 18.867h-1089.11v855.306h1089.11v-855.306zM654.058 347.376c-68.069 0-384.74 316.671-565.272 506.081l41.434 41.434c219.006-227.884 473.526-473.526 523.838-488.324 53.272 14.798 304.832 257.48 523.838 488.324l44.393-41.434c-145.017-150.936-488.324-506.081-568.231-506.081z" />
<glyph unicode="&#xe903;" glyph-name="menu" horiz-adv-x="1334" d="M1333.882 802.576l-1331.399-315.344-2.483 157.424 1331.399 315.344zM1333.882 520.504l-1331.399-314.848-2.483 157.424 1331.399 314.848zM1333.882 251.344l-1331.399-315.344-2.483 157.424 1331.399 315.344z" />
<glyph unicode="&#xe904;" glyph-name="linkedin" horiz-adv-x="1027" d="M941.133 960h-855.306c-47.353 0-85.827-38.474-85.827-85.827v-855.306c0-47.353 38.474-85.827 85.827-85.827h855.306c47.353 0 85.827 38.474 85.827 85.827v855.306c0 47.353-38.474 85.827-85.827 85.827zM941.133 18.867h-855.306v855.306h855.306v-855.306zM248.601 548.624c-8.879 8.879-14.798 20.717-14.798 35.514s5.919 26.636 14.798 35.514c8.879 8.879 20.717 14.798 38.474 14.798s26.636-5.919 38.474-14.798c8.879-8.879 14.798-20.717 14.798-35.514s-5.919-26.636-14.798-38.474c-8.879-8.879-23.676-14.798-38.474-14.798-17.757 2.96-29.595 8.879-38.474 17.757zM242.682 474.636h82.867v-361.064h-82.867v361.064zM751.723 439.121c26.636-26.636 41.434-65.11 41.434-118.382v-207.168h-82.867v195.329c0 32.555-8.879 56.231-23.676 71.029s-35.514 23.676-65.11 23.676c-29.595 0-56.231-8.879-73.988-26.636s-26.636-44.393-26.636-79.908v-183.491h-82.867v361.064h79.908v-47.353c14.798 17.757 32.555 29.595 53.272 38.474s44.393 11.838 71.029 11.838c44.393 0 82.867-11.838 109.503-38.474z" />
<glyph unicode="&#xe905;" glyph-name="plus" d="M992 576h-352v352c0 17.664-14.304 32-32 32h-192c-17.696 0-32-14.336-32-32v-352h-352c-17.696 0-32-14.336-32-32v-192c0-17.696 14.304-32 32-32h352v-352c0-17.696 14.304-32 32-32h192c17.696 0 32 14.304 32 32v352h352c17.696 0 32 14.304 32 32v192c0 17.664-14.304 32-32 32z" />
<glyph unicode="&#xe906;" glyph-name="less" d="M32 576h960c17.696 0 32-14.336 32-32v-192c0-17.696-14.304-32-32-32h-960c-17.664 0-32 14.304-32 32v192c0 17.664 14.336 32 32 32z" />
</font></defs></svg>

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Binary file not shown.

View File

@ -1,237 +0,0 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="pt" xml:lang="pt">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta content="width=device-width, initial-scale=1, user-scalable=0" name="viewport">
<meta content="width" name="MobileOptimized">
<meta content="true" name="HandheldFriendly">
<!-- Place favicon.ico in the root directory -->
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#000000">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="theme-color" content="#ff0000">
<title>ENEI'19</title>
<meta name="description"
content="Página do Encontro Nacional de Estudantes de Informática 2019, no Instituto Superior de Engenharia de Coimbra (ISEC) a realizar-se entre 12 e 15 de abril de 2019. O ENEI pretende oferecer aos estudantes de todo o país um evento que promove a aprendizagem, a troca de ideias e o convívio, enquanto tenta criar fortes ligações com o mundo empresarial.">
<meta property="og:locale" content="pt_PT" />
<meta property="og:title" content="ENEI'19" />
<meta property="og:description"
content="Página do Encontro Nacional de Estudantes de Informática 2019, no Instituto Superior de Engenharia de Coimbra (ISEC) a realizar-se entre 12 e 15 de abril de 2019. O ENEI pretende oferecer aos estudantes de todo o país um evento que promove a aprendizagem, a troca de ideias e o convívio, enquanto tenta criar fortes ligações com o mundo empresarial." />
<meta property="og:site_name" content="ENEI'19" />
<meta property="og:url" content="http://www.enei.pt/" />
<meta property="og:image" content="http://www.enei.pt/imgs/share-image.jpg" />
<meta property="og:type" content="Website" />
<link rel="canonical" href="http://www.enei.pt/" />
<link href="bootstrap-grid.css" rel="stylesheet" type="text/css" />
<link href="main.css" rel="stylesheet" type="text/css" />
<link href="https://fonts.googleapis.com/css?family=Bai+Jamjuree:400,600,700" rel="stylesheet">
</head>
<body>
<header id="main-menu">
<nav>
<a href="#" title="Abrir menu" rel="nofollow" id="open-menu-mobile">Menu</a>
<ul>
<li><a href="#enei" title="Enei">Enei</a></li>
<li class="unavailable">Oradores</li>
<li class="unavailable">Programa</li>
<li><a href="#precos" title="Preços">Preços</a></li>
<li class="unavailable">App</li>
<li class="unavailable">Patrocinadores</li>
<li><a href="#faqs" title="Faq's">Faq's</a></li>
</ul>
</nav>
</header>
<!-- apresentation section -->
<div id="apresentation">
<img src="imgs/logo-enei.png" alt="Logótipo ENEI" width="221" height="333" class="logo-enei">
</div>
<!-- enei section -->
<section id="enei">
<div class="container">
<div class="col-lg-7 col-sm-7">
<div class="pre-h1">12 A 15 ABRIL DE 2019</div>
<h1>ENEI</h1>
<hr>
<p>O Encontro Nacional de Estudantes de Informática é um dos maiores eventos na área da tecnologia em
Portugal
reunindo estudantes de informática de todas as faculdades do país.</p>
<p>Reconhecido pela sua qualidade e variedade de temas e atividades, tem como prioridade o contacto
entre
participantes e empresas, bem como a socialização, o convívio e a troca de experiências e
conhecimentos
entre os presentes.</p>
</div>
</div>
</section>
<!-- count down section -->
<aside id="countdown">
<div>
<span class="days"></span>
<div class="smalltext">Dias</div>
</div>
<div>
<span class="hours"></span>
<div class="smalltext">Horas</div>
</div>
<div>
<span class="minutes"></span>
<div class="smalltext">Minutos</div>
</div>
<div>
<span class="seconds"></span>
<div class="smalltext">Segundos</div>
</div>
</aside>
<!-- precos section -->
<section id="precos">
<div class="container">
<div class="col-lg-10 col-lg-offset-1 col-sm-12 col-xs-10 col-xs-offset-1">
<div class="pre-h1">ENEI'19</div>
<h1>Preços</h1>
<hr>
<div class="price-block">
<div class="type">Early-Bird</div>
<div>
<div class="individual-price">
<div class="price"><span></span>33</div>
<div class="label">Grupo</div>
<span class="options">*Alimentação e alojamento incluídos</span>
</div>
</div>
<a href="https://tickets.enei.pt/GROUP" title="Comprar" target="_blank" class="buy-button">Comprar</a>
</div>
<div class="price-block">
<div class="type">Early-Bird</div>
<div>
<div class="individual-price">
<div class="price"><span></span>30</div>
<div class="label">Individual</div>
<span class="options">*Alimentação e alojamento incluídos</span>
</div>
</div>
<a href="https://tickets.enei.pt" title="Comprar" target="_blank"class="buy-button">Comprar</a>
</div>
<div class="price-block disable">
<div class="type">Pontual</div>
<div class="individual-price">
<div class="price"><span></span>20</div>
<div class="label">Individual</div>
<span class="options">*Alimentação incluída</span>
</div>
<span class="buy-button">Brevemente</span>
</div>
</div>
</div>
</section>
<!-- Faqs -->
<section id="faqs">
<div class="container">
<div class="col-lg-5">
<div class="pre-h1">Perguntas Frequentes</div>
<h1>Faq</h1>
<hr>
</div>
<div class="col-lg-10">
<ul id="accordion">
<li>
<a href="#" title="O que é o ENEI?" rel="nofollow" class="toggle">O que é o ENEI?</a>
<div class="content-accordion">
<p>O Encontro Nacional de Estudantes de Informática (ENEI) é um evento que pretende
oferecer aos estudantes de todo o país um evento que promove a aprendizagem, a troca de
ideias e o convívio, enquanto tenta criar fortes ligações com o mundo empresarial.</p>
<p> A 13ª edição do evento terá lugar no Instituto Superior de Engenharia de Coimbra (ISEC)
entre os dias 12 e 15 de abril de 2019 e a organização espera contar com 700 estudantes
que poderão participar em palestras, workshops e painéis de discussão, contando com
oradores de renome nacional e internacional.</p>
<p>Esta versão do evento também incluirá os tradicionais momentos de diversão noturnos que
muito apelam a todos os participantes das antigas edições e são uma excelente via de
networking e transferência de conhecimento!</p>
</div>
</li>
<li>
<a href="#" title="Onde me posso inscrever?" rel="nofollow" class="toggle">Onde me posso
inscrever?</a>
<div class="content-accordion">
<p>Os bilhetes estarão disponíveis a partir de XXX. Está atento às nossas redes sociais
para estares a par de tudo sobre o ENEI19!</p>
<p>Podes adquirir o teu bilhete <a href="#" title="Aqui">AQUI</a>.</p>
</div>
</li>
<li>
<a href="#" title="Quem pode participar no evento?" rel="nofollow" class="toggle">Quem pode
participar no evento?</a>
<div class="content-accordion">
<p>Podem participar no ENEI19 todos os estudantes de cursos relacionados com informática e
todos aqueles que querem aprender mais sobre os temas abordados!</p>
</div>
</li>
<li>
<a href="#" title="Tenho acesso a todas as sessões?" rel="nofollow" class="toggle">Tenho
acesso a todas as sessões?</a>
<div class="content-accordion">
<p>As palestras e workshops necessitam de inscrições e são limitadas. Aconselhamos-te a
escolher um Career Path para te facilitar a inscrição e aproveitares ao máximo. As
sessões de cocktails e de networking, assim como o Jantar Empresarial precisam, também,
de inscrição prévia. Mantém-te atento às nossas redes sociais!</p>
</div>
</li>
</ul>
<a href="#" title="Ver todas" class="btn btn-default">Ver todas</a>
</div>
</div>
</section>
<!-- social network section -->
<aside id="social-network">
<div class="container">
<div class="col-lg-8 col-lg-offset-2">
<h2>Siga-nos</h2>
<ul>
<li><a href="https://www.facebook.com/ENEIConf/" title="Facebook" target="_blank"
class="icon-facebook"></a></li>
<li><a href="https://www.instagram.com/eneiconf/" title="Instagram" target="_blank"
class="icon-instagram"></a></li>
<li><a href="https://www.linkedin.com/company/enei/" title="Linkedin" target="_blank"
class="icon-linkedin"></a></li>
<li><a href="mailto:geral@enei.pt" title="Email" target="_blank" class="icon-email"></a></li>
</ul>
</div>
</div>
</aside>
<!-- footer -->
<footer>
<div class="container">
<div class="col-lg-12">
<p>© 2018 ENEI . Todos os direitos reservados</p>
</div>
</div>
</footer>
<!-- Scripts -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script type="text/javascript" src="js/scripts.js"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src=“https://www.googletagmanager.com/gtag/js?id=UA-130588243-1“> </script> <script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag(js, new Date());
gtag(config, UA - 130588243 - 1);
</script>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@ -1,18 +0,0 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="260.000000pt" height="260.000000pt" viewBox="0 0 260.000000 260.000000"
preserveAspectRatio="xMidYMid meet">
<metadata>
Created by potrace 1.11, written by Peter Selinger 2001-2013
</metadata>
<g transform="translate(0.000000,260.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
<path d="M2045 2540 c-55 -15 -221 -60 -370 -100 -148 -40 -308 -82 -355 -95
-47 -12 -148 -39 -225 -60 -325 -86 -581 -156 -602 -165 l-21 -9 0 -1045 c0
-723 4 -1046 11 -1046 6 0 87 21 181 46 94 25 178 47 186 49 8 2 83 22 165 44
83 22 184 50 225 61 41 11 143 38 225 61 83 22 159 43 170 45 11 2 133 35 270
72 l250 68 0 1043 c0 573 -2 1046 -5 1050 -3 5 -50 -4 -105 -19z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 888 B

File diff suppressed because one or more lines are too long

View File

@ -83,13 +83,12 @@
<script type="text/javascript" src="js/scripts.js"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-130588243-1"></script>
<script>
<script async src=“https://www.googletagmanager.com/gtag/js?id=UA-130588243-1“> </script> <script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag(js, new Date());
gtag('config', 'UA-130588243-1');
gtag(config, UA - 130588243 - 1);
</script>
</body>

View File

@ -66,13 +66,13 @@
<script type="text/javascript" src="js/scripts.js"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-130588243-1"></script>
<script async src=“https://www.googletagmanager.com/gtag/js?id=UA-130588243-1“></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag(js, new Date());
gtag('config', 'UA-130588243-1');
gtag(config, UA-130588243-1);
</script>
</body>

View File

@ -84,13 +84,12 @@
<script type="text/javascript" src="js/scripts.js"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-130588243-1"></script>
<script>
<script async src=“https://www.googletagmanager.com/gtag/js?id=UA-130588243-1“> </script> <script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag(js, new Date());
gtag('config', 'UA-130588243-1');
gtag(config, UA - 130588243 - 1);
</script>
</body>

View File

@ -121,28 +121,29 @@
<h1>Preços</h1>
<hr>
<div class="price-block">
<div class="type">Normal</div>
<div class="type">Early-Bird</div>
<div>
<div class="individual-price">
<div class="price"><span></span>25</div>
<div class="label">Grupo</div>
<span class="options">*Alimentação [5€] e alojamento (pavilhão) [5€]</span>
<span class="options">*Alimentação e alojamento (pavilhão) incluídos</span>
</div>
</div>
<span class="buy-button">Brevemente</span>
<a href="https://tickets.enei.pt/group" title="Comprar" target="_blank"
class="buy-button">Comprar</a>
</div>
<div class="price-block">
<div class="type">Normal</div>
<div class="type">Early-Bird</div>
<div>
<div class="individual-price">
<div class="price"><span></span>30</div>
<div class="label">Individual</div>
<span class="options">*Alimentação [5€] e alojamento (pavilhão) [5€]</span>
<span class="options">*Alimentação e alojamento (pavilhão) incluídos</span>
</div>
</div>
<span class="buy-button">Brevemente</span>
</div>
<div class="price-block">
<a href="https://tickets.enei.pt" title="Comprar" target="_blank" class="buy-button">Comprar</a>
</div>
<div class="price-block disable">
<div class="type">Pontual</div>
<div class="individual-price">
<div class="price"><span></span>20</div>
@ -276,6 +277,7 @@
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script type="text/javascript" src="js/scripts.js"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-130588243-1"></script>
<script>